*
The moose likes JSP and the fly likes Using JspWriter for Devloping Custom Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Using JspWriter for Devloping Custom Tag" Watch "Using JspWriter for Devloping Custom Tag" New topic
Author

Using JspWriter for Devloping Custom Tag

srujana maredugu
Greenhorn

Joined: Jan 10, 2008
Posts: 8
Hi,

I am trying to develop custom tag for getting the circles in drop down box.
i am trying to add circles with spaces like (Andhra Pradesh,Tamil Nadu etc).
But in javascript i am not able get the full name.

Please find this code:

HttpServletRequest req=(HttpServletRequest)pageContext.getRequest();
JspWriter out=pageContext.getOut();

out.print("<html>");
out.print("<body>");
out.print("<form name=circleform method=GET>");
out.print("circle:<select name=circles onchange=getCircle(this)>");
out.print("<option>select</option>");
while(rs.next())
{

out.print("<option value=Andhra Pradesh>Andhra Pradesh</option>");
}
out.print("</form>");
out.print("</body>");
out.print("</html>");


but same i am trying in javascript function , i am getting like 'Andhra' only not full name.

Please suggest me how to get full name if it contains spaces

Thanks & Regards
Srujana
Baseet Ahmed
Ranch Hand

Joined: Dec 18, 2006
Posts: 224
srujana,

Have tried with single or double quotes i.e
"<option value='Andhra Pradesh'>Andhra Pradesh</option>"
OR
"<option value="Andhra Pradesh">Andhra Pradesh</option>"

But in out.print method you have to esacpe the quotes with the help of \ character.

Hope,this is what you are expecting.

Regards
Baseet Ahmed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using JspWriter for Devloping Custom Tag