Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 10th, 2006, 10:07 PM
Authorized User
 
Join Date: Aug 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tusharkale
Default servlet call using hyperlink

how to call servlet using an hyperlink....



Reply With Quote
  #2 (permalink)  
Old August 16th, 2006, 03:30 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You just link to it. Did you set it up in web.xml? What servlet-mapping did you use? Based on the servlet-mapping and the context root of your web application, it should be pretty straight-forward to figure out the URL to use.

Jon Emerson
http://blogs.adobe.com/jon.emerson/
Reply With Quote
  #3 (permalink)  
Old April 9th, 2007, 10:02 AM
Registered User
 
Join Date: Apr 2007
Location: pune, maharashtra, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to suhasdoke
Default

Quote:
quote:Originally posted by panacea
 You just link to it. Did you set it up in web.xml? What servlet-mapping did you use? Based on the servlet-mapping and the context root of your web application, it should be pretty straight-forward to figure out the URL to use.

Jon Emerson
http://blogs.adobe.com/jon.emerson/
can u give me detailed information about how can i call the servlet on click on a hyperlink.

suhas
Reply With Quote
  #4 (permalink)  
Old April 23rd, 2007, 11:06 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

Think that you've defined a servlet "callme" and web.xml has been configured for this servlet. Use the following syntax to call it using hyperlink

<a href="http://yourdomain:yourport/callme">Call the servlet</a>

Regards,
Rakesh
Reply With Quote
  #5 (permalink)  
Old October 3rd, 2007, 06:02 AM
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

web.xml

<servlet>
    <description>All XML Functions</description>
    <display-name>XMLTestServlets</display-name>
    <servlet-name>XMLTestServlets</servlet-name> <servlet-class>com.test.testProjects.XMLTestServlets</servlet-class>
    </servlet>

<servlet-mapping>
    <servlet-name>XMLTestServlets</servlet-name>
    <url-pattern>/XMLTestServlets</url-pattern>
</servlet-mapping>



in JSP:

<a href="<%=request.getContextPath()%>/XMLTestServlets">Link Name</a>

just try this...

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Servlet Call Applet azimdgreat Servlets 2 July 16th, 2008 05:48 AM
( C# in ASP.NET ) can a hyperlink call a function? richie86 ASP.NET 1.0 and 1.1 Basics 0 November 5th, 2005 01:25 AM
Can I call a servlet from a JFram madas Servlets 5 September 26th, 2005 12:52 PM
How Can I call a HTML file from a servlet? alf.guzman Servlets 3 January 24th, 2005 04:51 AM



All times are GMT -4. The time now is 10:18 PM.


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