You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mark Qian <ma...@hotmail.com> on 2006/02/12 06:44:28 UTC

Write plain html when encoding in JSF

I tried to create a JSF tag component containing two or more HTML
tables but by default
writer.endElement and writer.startElement seems to deal with a single
HTML
component only.

How do people output their HTML in case that they want to write
something like


<table>...</table>
<table>...</table>


in a encodeBegin or encodeEnd?


Will following way


public void encodeBegin(FacesContext context) throws IOException
  {
   ResponseWriter writer = context.getResponseWriter();


      writer.writeText("<table>...</table>
<table>...</table>", null);


  }


work?


thanks



Re: Write plain html when encoding in JSF

Posted by Volker Weber <us...@weber-oldenburg.de>.
Hi,

Mark Qian wrote:
> I tried to create a JSF tag component containing two or more HTML
> tables but by default
> writer.endElement and writer.startElement seems to deal with a single
> HTML
> component only.
> 
> How do people output their HTML in case that they want to write
> something like
> 
> 
> <table>...</table>
> <table>...</table>

writer.startElement("table", null);
// write content of first table
writer.endElement("table");

writer.startElement("table", null);
// write content of second table
writer.endElement("table");

> 
> 
> in a encodeBegin or encodeEnd?
> 
> 
> Will following way
> 
> 
> public void encodeBegin(FacesContext context) throws IOException
>  {
>   ResponseWriter writer = context.getResponseWriter();
> 
> 
>      writer.writeText("<table>...</table>
> <table>...</table>", null);
> 
> 
>  }
> 
> 
> work?

yes, but i would prefer the above.

> 
> 
> thanks
> 
> 

Regards,
  Volker
-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.