You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Kedar Upadhye <Ke...@eyield.com> on 2002/06/21 13:32:47 UTC

Taglib problem

Hi,

I have something like this in one of my tag classes :

	pageContext.getOut().print("<TD class=\"label\">Group Name</TD>");
	pageContext.getOut().print("<TD><INPUT id=text1 name=text1 value=");
	str = pageContext.getRequest().getServerName() + " " + pageContext.getRequest().getRemoteAddr();			
	pageContext.getOut().println(str);//pageContext.getOut().print(str);
	pageContext.getOut().print("></TD>");

The value assigned to str variable is "localhost ipaddress". It shows it correctly if I print it to System.out. But on the html page all it shows is the first word: i.e. "localhost". If however I hard code the same value (using escape sequences) then it works correctly. Do I have to make setting to show a complete strings (multiple words) or what it is ?

regards
-- Kedar



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Taglib problem

Posted by Nicolas De Loof <ni...@cgey.com>.
You have to build your INPUT Tag "value" attribute with quote delimiters.
If you don't use this quotes, first blank character is interpreted as end of
the value string.

You should try to get used using XHTML notation for your HTML code, with
lowercase tags and quoted attribute values:

pageContext.getOut().print("<td class=\"label\">Group Name</td>");
pageContext.getOut().print("<td><input id=\"text1\" name=\"text1\"
value=\"");
pageContext.getOut().print(str);
pageContext.getOut().print("\"></td>");

Nico


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>