Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
|
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 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 August 10th, 2006, 10:07 PM
Authorized User
 
Join Date: Aug 2006
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....



 
Old August 16th, 2006, 03:30 AM
Friend of Wrox
 
Join Date: Jan 2006
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/
 
Old April 9th, 2007, 10:02 AM
Registered User
 
Join Date: Apr 2007
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
 
Old April 23rd, 2007, 11:06 PM
Friend of Wrox
 
Join Date: Mar 2007
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
 
Old October 3rd, 2007, 06:02 AM
Registered User
 
Join Date: Oct 2007
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...






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





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