How do you set and html attribute to some jsp variable?

K

Ken Adams

Bascially I got
<% String myString = request.getParameter("blah")%>

Now futher down I want to set a textfield to that value.
i have tried this but it claims that it doesn't know what id is. How do I
reference it.
The reason I don't just put the request.getParameter right in the html
tag,which I know works, is because I want to do some further manipulation to
the string before I set the value of the txt field. Also it isn't very
convient to put the html tag inside the jsp for maintenance issuse.

<input type="text" name="id" value="<%=id%>" >


Thanks Alot
 
J

J2Be

Ken Adams said:
Bascially I got
<% String myString = request.getParameter("blah")%>

Now futher down I want to set a textfield to that value.
i have tried this but it claims that it doesn't know what id is. How do I
reference it.
The reason I don't just put the request.getParameter right in the html
tag,which I know works, is because I want to do some further manipulation to
the string before I set the value of the txt field. Also it isn't very
convient to put the html tag inside the jsp for maintenance issuse.

<input type="text" name="id" value="<%=id%>" >


Thanks Alot


<% String myString = request.getParameter("blah")%>
if you want to get the values from the
----> <input type="text" name="id" value="<%=id%>" > <----
you've to use
<% String myString = request.getParameter("id")%>

and after checking that myString is set
<input type="text" name="id" value="<%=myString%>" >


please explain better your problem if that's not what you meant
in your question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top