File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Help me in send redirct Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Help me in send redirct" Watch "Help me in send redirct" New topic
Author

Help me in send redirct

mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 243

Hi,
I am designing some sample project which should connect to database, and get data and display it in jsp using JSTL.It is working well The worst part is to edit,view,delete (fields at end of each row) they are links and i have to send it to servlet and get data for particular field and display back in jsp(MVC Archetecture).

Please help me to Redirect the link to Servlet


It display like

Empnumber First Name Last Name Gender Age Address Options

1 Ramya Swati FeMale 26 somelocationl Edit Add Delete
2 Raj Kumar Male 23 somelocationl Edit Add Delete
3 Kalpana Fe Male 25 somelocationl Edit Add Delete
4 Raja Pintu Male 19 somelocationl Edit Add Delete


When i click the link it should redirect to servlet and get data of the row from servlet and display it in JSP
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Hi
You could use something like


Learning and Learning!-- Java all the way!
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 243

I want to redirect to servlet
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Well you could submit to the same jsp and have a form in the jsp that submits to your servlet?
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 243

I am restricted to use any kind of buttons
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

thats a weird restriction , maybe you try just specifying your servlet instead of the jsp file in my snippet . Not sure though
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 243

What is id in your snippet
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Id is something i put in for your reference for say you want to uniquely identify a row in your table and then do DB operations with that particular row.
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 243

Thanks it is working
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 243

How to get the ID in Sevlet
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 243

Hy can any one tell me how to get value from id in Servlet

I Used request.getParameter("emp_id");

But it's prints null value and i used

It is also showing null value.
Please Help me Please Urgent
Mike Zal
Ranch Hand

Joined: May 04, 2011
Posts: 144

You should use the url tag in JSTL core library to create your URLs. It should look something like the following



This will send a request to the Servlet specified by the URL in the value attribute with two request parameters named empId and action.


OCJP6, OCWCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help me in send redirct
 
Similar Threads
how to get the value saved in request scope in a servlet into a jsp page
Pagination using display tag and JSTL.Display problem
Display data from database to jsp page.
I cant set any values in my Action Form for Contact object:
Passing row id from html table on jsp to Action Class in Struts