Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 30th, 2007, 05:05 AM
Registered User
 
Join Date: Apr 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mona_1dec
Default how to get linkname from jsp to struts action clas

Hi ,
I want to get name of link from jsp page to my struts action class when I click the link.
following is in my jsp page
Code:
 <a href="getJobDetails.do"><bean:write name="jobActionForm" property="jobName" /></a>  
when I click on perticular job name the jobname should be pass to my struts action
I tried to get this name like follow
Code:
 String jobName=request.getParameter("jobName");
but it taking null value..
can anybody help me plz?
Thanks in advance.

Monali Swarge
 
Old April 30th, 2007, 12:43 PM
Registered User
 
Join Date: Mar 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use struts link tag so that you can get link name as the name for the attribute.
<html:link/>
or use name attribute in <a name="jobname" href="getJobDetails.do"><bean:write name="jobActionForm" property="jobName"/></a>

in action class you can get the name :
String jobName = request.getParameter("jobname");

 
Old May 2nd, 2007, 01:04 AM
Registered User
 
Join Date: Apr 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mona_1dec
Default

I have already tried this.
But it also not working. the same problem.

Monali Swarge





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to display errors on jsp from action ntando Javascript How-To 0 December 5th, 2006 06:32 PM
How to display errors from Action class on the jsp ntando HTML Code Clinic 0 December 5th, 2006 06:30 PM
<jsp:useBean> action problem austinf JSP Basics 1 August 21st, 2006 04:23 PM
Struts 1.2 version extending RequestProcessor clas varun_java Apache Tomcat 0 February 25th, 2005 09:42 AM
How to get servletConfig in Struts Action? cash J2EE 0 October 25th, 2004 09:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.