Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes problem in html:hidden tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in html:hidden tag" Watch "problem in html:hidden tag" New topic

problem in html:hidden tag

Himanshu Rawat
Ranch Hand

Joined: Nov 27, 2005
Posts: 141

i m sending a hidden variable inside the form.code for hidden variable is
<html:hidden property="fileName" value="<bean:write name="libDocumentInfo1" property="libDocumentName" />"/>

its givin me error :-
org.apache.jasper.JasperException: /jsp/Library/LibraryMainPage.jsp(121,76) equal symbol expected.

form name and property are right and i suppose its synatx error..
can nybody tell me how to correct it??

SCJP 1.4
Liju Cherian
Ranch Hand

Joined: Mar 17, 2006
Posts: 44
Hi Rawat,

You cannot use one struts tag inside another. In the above code u r using <bean:write> within the <html:hidden> tag; i.e. why u r getting such an error.

Try using this instead,

Hope this helps.


"What's in a name? That which we call a rose by any other name would smell just as sweet."<br />(William Shakespeare, Romeo and Juliet, Act II, Scene II)
Himanshu Rawat
Ranch Hand

Joined: Nov 27, 2005
Posts: 141
thanx for helping and ur code worked bt with a slight change..

<input type="hidden" name="val" value="<bean:write name="libDocumentInfo1" property="libDocumentName" />" /> (property is nt defined).

now i m trying to retrieve the value in javascript like this..

alert(document.all.val.value); its giving me undefined ??? when i checked the source code "value" atrribute is having value bt nt giving me in javascript.

can u tell me how to get it in javscript???
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Try document.myForm.val.value where myForm is the name of the form. In Struts this is the name of the ActionForm used by the action called by the form.

If you only have one form on the page, this will work also:


Consultant, Sima Solutions
I agree. Here's the link:
subject: problem in html:hidden tag
It's not a secret anymore!