Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help me in send redirct

 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
You could use something like
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to redirect to servlet
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you could submit to the same jsp and have a form in the jsp that submits to your servlet?
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am restricted to use any kind of buttons
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is id in your snippet
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks it is working
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to get the ID in Sevlet
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 144
Fedora Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic