1 Reply Latest reply on Nov 10, 2008 7:41 PM by mail.micke

    Handling RAW HTML in Seam?

    paulmkeogh

      Hi,


      I have a seam component that uses HTTPClient to retrieve a web page. This works fine and I can display the return HTML string using a h:outputText element.


      Can someone tell me (or point me at) how to open a new window/frame to display the returned page ? This sounds simple to me, but I cannot find any references or samples on how to do it.


      Thanks,

        • 1. Re: Handling RAW HTML in Seam?
          mail.micke

          How about something like this.


          In the page that opens up the new page:


          <h:outputLink value="/showContent.jsf" target="_blank">
          <f:param name="param" value="#{someBean.someValue}"/>
          </h:outputLink>
          


          The backing bean behind the showContent.jsf page :


          @Name("showContentBacking")
          @Scope(ScopeType.EVENT)
          public class ShowContentBacking .... {
          
          @RequestParameter("param")
          String reqParam;
          
          private String htmlString;
          
          @Create
          public void init(){
          
              htmlString = //HttpClient call using the reqParam
          
          }
           
          // getters and setters
          }
          



          Then just create a showContent.xhtml page which gets the htmlString from the event scoped backing bean.


          Just typed the stuff in here so there are probably loads of errors.


          cheers,
          Micke