File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in html:hidden tag" Watch "problem in html:hidden tag" New topic
Author

problem in html:hidden tag

Himanshu Rawat
Ranch Hand

Joined: Nov 27, 2005
Posts: 141
hi,

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??


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

Liju


"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
hi,
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:

document.forms[0].val.value


Merrill
Consultant, Sima Solutions
 
wood burning stoves
 
subject: problem in html:hidden tag