Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

passing bean to a java function in jsp scriplet

Thread view: 
A r F a N - 29 Nov 2005 14:40 GMT
I have to pass the value of form bean property to a java class funtion.
I am using the following syntax and it is giving me syntax error. can
any1 help  me in it ?

<tr>
<td>
<%=myJavaClass.formatContent('<bean:write name="myActionForm"
property="name"/>');%>
</td>
</tr>
Markus - 29 Nov 2005 15:40 GMT
Try this:

<tr>
<td>
<bean:define id="test" name="myActionForm"
type="org.apache.struts.action.ActionForm"/>
<%=myJavaClass.formatContent(test.getName());%>
</td>
</tr>

I think org.apache.struts.action.ActionForm should be your own
ActionForm-Class.

kind regards

Markus
A r F a N - 30 Nov 2005 06:30 GMT
thx Markus for simplifyin my work :)
Scott Smith - 30 Nov 2005 14:28 GMT
> I have to pass the value of form bean property to a java class funtion. I
> am using the following syntax and it is giving me syntax error. can any1
[quoted text clipped - 3 lines]
> <td>
> <%=myJavaClass.formatContent('<bean:write name="myActionForm"
   ^ Either get rid of the equals sign or...
> property="name"/>');%>
                    ^ get rid of the semi-colon
> </td>
> </tr>

Signature

R. Scott Smith
Phoenix, AZ, USA
Slackware on the job, at home, everywhere!

Scott Smith - 30 Nov 2005 14:32 GMT
>> I have to pass the value of form bean property to a java class funtion.
>> I am using the following syntax and it is giving me syntax error. can
[quoted text clipped - 8 lines]
>> </td>
>> </tr>
Looks like my post wasn't formatted properly.  

It should either be:
<% myJavaClass.formatContent('<bean:write name="myActionForm"
property="name"/>');%>

Or:
<%=myJavaClass.formatContent('<bean:write name="myActionForm"
property="name"/>') %>

Signature

R. Scott Smith
Phoenix, AZ, USA
Slackware on the job, at home, everywhere!



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.