This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Using JspWriter for Devloping Custom Tag" Watch "Using JspWriter for Devloping Custom Tag" New topic

Using JspWriter for Devloping Custom Tag

srujana maredugu

Joined: Jan 10, 2008
Posts: 8

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("<form name=circleform method=GET>");
out.print("circle:<select name=circles onchange=getCircle(this)>");

out.print("<option value=Andhra Pradesh>Andhra Pradesh</option>");

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
Baseet Ahmed
Ranch Hand

Joined: Dec 18, 2006
Posts: 224

Have tried with single or double quotes i.e
"<option value='Andhra Pradesh'>Andhra Pradesh</option>"
"<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.

Baseet Ahmed
I agree. Here's the link:
subject: Using JspWriter for Devloping Custom Tag
Similar Threads
Passign variable from javascript form to JSP
JSP EL not working
unable to access the attribute in any of the container scope
Tutorial on Dynamic Attributes
page refresh problem