Solved

bean + struts JSP

Posted on 2004-10-04
4
1,731 Views
Last Modified: 2008-02-01
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
Comment
Question by:ldbkutty
  • 2
  • 2
4 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 400 total points
ID: 12217573
0
 
LVL 7

Assisted Solution

by:lhankins
lhankins earned 100 total points
ID: 12218435
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
 
LVL 7

Expert Comment

by:lhankins
ID: 12219577
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
 
LVL 37

Expert Comment

by:zzynx
ID: 12246955
Thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now