Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1742
  • Last Modified:

bean + struts JSP

how can i assign a bean value to my JSP variable.

somtheing like:
<% String test = "<bean:write name=\"currentDate\" property=\"dateFormatted\" />"; %>

Ofcourse my syntax is wrong, but just to demonstrated you.
0
ldbkutty
Asked:
ldbkutty
  • 2
  • 2
2 Solutions
 
zzynxSoftware engineerCommented:
0
 
lhankinsCommented:
If you want to define a new scriptlet variable based off one of your available beans, you can use the <bean:define> tag.  For example, the following will assign the value of someBean.getSomeProperty() to the scriptlet variable "somevar"

   <bean:define id="someVar" name="someBean" property="someProperty"/>
   <input type="hidden" name="bleh" value="<%=someVar%>"/>
0
 
lhankinsCommented:
BTW - the second line  above (the <input> tag) is just an example of how to reference the scriptlet variable (it has no meaning other than that)

0
 
zzynxSoftware engineerCommented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now