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

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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

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

Quoted text here. Click to load it

<% 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.

Site Timeline