struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abhiram <abhi_...@yahoo.com>
Subject how to set hidden field value to a session attribute ?
Date Thu, 05 Apr 2007 13:20:51 GMT
hi friends!! 
  im new to struts and im developing a web application using struts and jsp.
   
  in one scenario,i want to set  the value of a string variable of a formbean to a session
attribute through jsp.bcoz  form bean is populated only when  formdata is submitted,i wrote
a hidden field in the jsp. i dont know how to set the value of a hidden field to a session
attribute.
   
  i wrote this in my jsp
   
  <html:html>
   <html:form>
    <!-- some code for uploading here -->
     <html:hidden property="albumId" value="<%= session.getAttribute("albId")"  
           %>
     <html:submit>Upload Files</html:submit>
   </html:form>
  
  </html:html>
   
  in a previous Action class, i set a session attribute to the string albId, and now, i want
to send it to a form bean.
   
  the jsp above returnd a compilation error.my appln server is apache tomcat 5.5.9
  the error is like this
   
  org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 57 in the jsp file: /PicUploadForm.jsp
Generated servlet error:
The method setValue(String, Object) in the type TagSupport is not applicable for the arguments
(Object)

   
  please suggest how to send my session attribute value into the formbean.


      abhiram




 				
---------------------------------
 Here’s a new way to find what you're looking for - Yahoo! Answers 
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message