• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

how to call a jsp function with in a hyperlink

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai all,
Can anyone help me??
Can we call a jsp function from a hyperlink in jsp page ?? I am developing one small web application. In that application, i
have to display the id numbers of all employees. If I click on one employee id, i have to display details of that employee.
My data bse is aceess database. I could display the details of employee id s in a table with hyperlinks to employee ids. How to
display the details of that employee. I have tried with jsp functions and java script function. But no use. Could anyone one please help me out.
thanks in advance.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A JSP represents a web page, exactly the same as any other HTML web page. You can just put the address of the JSP in the link - if you click on the link, your JSP will be executed. For example:

<a href="http://somewebsite.com/hello/customerdetails.jsp">Click here for details</a>

Usually, you'd want to pass some parameter to the JSP, so that it knows of which customer the details should be displayed. For example:

<a href="http://somewebsite.com/hello/customerdetails.jsp?cust_id=123">Click here for details of customer 123</a>
 
k kousalya
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jesper ,

But i have to display the details of employees in the same jsp page. how to do this ?? What thought is, divide the jsp page into two frames. I ll display id numbers in one frame, if i click on the employee id, details of that employee should be display in the second frame. How to do this. Please help me.
 
Marshal
Posts: 80279
432
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too difficult a question for us beginners. Moving.
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Investigate the target attribute of the tag.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use ajax.

- user clicks id
- you make ajax call to jsp page to get the info for that id
- return that info in a json object
- use a dialog box or display a hidden div to display the returned data in an organized fashion

This enables you to only pull and display the list of ids on page load, which makes the page faster. And provided your hardware is at least average and your server is set up correctly your users won't see much of a delay if any delay at all with the ajax call.

- andy c
 
Look ma! I'm selling my stuff!
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic