Re: calling servlets from jsp

2002-06-20 Thread chad kellerman

I have been working on this same thing for the past couple of days.

THe people on the list have been a great help.  While looking I came across a 
great article that shows step by step how to do this.

http://www.onjava.com/pub/a/onjava/2001/04/19/tomcat.html?page=1

hope this helps.

--chad


On Thu June 20 2002 12:16 pm, Alex wrote:
> Hello,
>
>  I want to call a servlet from a jsp ( i mean, when i press a button
>  in the html file generated by the jsp, i want to call a servlet).
>  for ex: document.location.href = "SERVLET";
>  How can i do this ?
>
>  Thanks in advance...
>  Alex.

-- 
Chad Kellerman
Alabanza Inc.
Jr. Systems Administrator
10 E. Baltimore Street
Baltimore, Md 21202

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: calling servlets from jsp

2002-06-20 Thread Brendan . Richards



Can you run the servlet in the first place?

for example using a URL such as this:

http://localhost:8080/webapp/servlet/ServletName

see the tomcat servlet examples (linked from the default home page)

if you can run the servlet just link to the servlet's URL like any other
URL.

If you haven't got a servlet running yet, read this:
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/deployment.html


Brendan



-

Hello,

 I want to call a servlet from a jsp ( i mean, when i press a button
 in the html file generated by the jsp, i want to call a servlet).
 for ex: document.location.href = "SERVLET";
 How can i do this ?

 Thanks in advance...
 Alex.



--
To unsubscribe, e-mail:

For additional commands, e-mail:





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: calling servlets from jsp

2002-06-20 Thread Mike Jackson

You need to do a number of things, assuming that I understand the question.

1) create your servlet (duh)

2) create jsp (duh also)

3) modify WEB-INF/web.xml

add servlet entry for the servlet, should look something like this:


foo
org.somewhere.Bar

foo
*.form


Note: the name of the servlet should be the same in both places and in
order to have tomcat auto-magically map the request to the servlet you
need have the link or action have the extension that you specify in the
url-pattern.

Now there's an added complication if you're not running tomcat stand alone
(ie
using mod_jk and apache or something) in that you'll need to also tell the
front end web server to pass the requests for your mapping through to tomcat
as well (this is the part that I *always* forget about).

If you have any problems setting this up email and I'll try to answer
questions
or provide examples.

--mikej
-=-
mike jackson
[EMAIL PROTECTED]

> -Original Message-
> From: Alex [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 20, 2002 9:17 AM
> To: [EMAIL PROTECTED]
> Subject: calling servlets from jsp
>
>
> Hello,
>
>  I want to call a servlet from a jsp ( i mean, when i press a button
>  in the html file generated by the jsp, i want to call a servlet).
>  for ex: document.location.href = "SERVLET";
>  How can i do this ?
>
>  Thanks in advance...
>  Alex.
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: calling servlets from jsp

2002-06-20 Thread chad kellerman

Mike,
 You said:
Now there's an added complication if you're not running tomcat stand alone
> (ie
> using mod_jk and apache or something) in that you'll need to also tell the
> front end web server to pass the requests for your mapping through to
> tomcat as well (this is the part that I *always* forget about).

what other config lines do you need?

-chad


On Thu June 20 2002 12:41 pm, Mike Jackson wrote:
> You need to do a number of things, assuming that I understand the question.
>
> 1) create your servlet (duh)
>
> 2) create jsp (duh also)
>
> 3) modify WEB-INF/web.xml
>
>   add servlet entry for the servlet, should look something like this:
>
>   
>   foo
>   org.somewhere.Bar
>   
>   add a mapping for a file extension to the servlet, looks like this:
>
>   
>   foo
>   *.form
>   
>
>   Note: the name of the servlet should be the same in both places and in
>   order to have tomcat auto-magically map the request to the servlet you
>   need have the link or action have the extension that you specify in the
>   url-pattern.
>
> Now there's an added complication if you're not running tomcat stand alone
> (ie
> using mod_jk and apache or something) in that you'll need to also tell the
> front end web server to pass the requests for your mapping through to
> tomcat as well (this is the part that I *always* forget about).
>
> If you have any problems setting this up email and I'll try to answer
> questions
> or provide examples.
>
> --mikej
> -=-
> mike jackson
> [EMAIL PROTECTED]
>
> > -Original Message-
> > From: Alex [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 20, 2002 9:17 AM
> > To: [EMAIL PROTECTED]
> > Subject: calling servlets from jsp
> >
> >
> > Hello,
> >
> >  I want to call a servlet from a jsp ( i mean, when i press a button
> >  in the html file generated by the jsp, i want to call a servlet).
> >  for ex: document.location.href = "SERVLET";
> >  How can i do this ?
> >
> >  Thanks in advance...
> >  Alex.
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 

-- 
Chad Kellerman
Alabanza Inc.
Jr. Systems Administrator
10 E. Baltimore Street
Baltimore, Md 21202

--
To unsubscribe, e-mail:   
For additional commands, e-mail: