Re[2]: calling servlets from jsp

2002-06-20 Thread Alex

Hello Brendan,

The path to my servlet is: "C:\tomcat401\webapps\ROOT\WEB-INF\classes\qc\achizitii"
My servlet is called "Tiparire.class"
The path for my jsp pages is: "C:\tomcat401\webapps\ROOT\qc\achizitii"
My tomcat server is running on port 80
My servlet is working, i'm sure.
How can i call my servlet from a jsp page ?

Alex.

Thursday, June 20, 2002, 7:29:42 PM, you wrote:



BRlc> Can you run the servlet in the first place?

BRlc> for example using a URL such as this:

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

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

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

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


BRlc> Brendan



BRlc> -

BRlc> Hello,

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

BRlc>  Thanks in advance...
BRlc>  Alex.



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




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



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




Re[2]: calling servlets from jsp

2002-06-20 Thread Alex

Hello Mike,

As i said:
The path to my servlet is: "C:\tomcat401\webapps\ROOT\WEB-INF\classes\qc\achizitii"
My servlet is called "Tiparire.class"
The path for my jsp pages is: "C:\tomcat401\webapps\ROOT\qc\achizitii"
Can you help me set up my server ?

Thanks in advance...
Alex

Thursday, June 20, 2002, 7:41:03 PM, you wrote:

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

MJ> 1) create your servlet (duh)

MJ> 2) create jsp (duh also)

MJ> 3) modify WEB-INF/web.xml

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

MJ> 
MJ> foo
MJ> org.somewhere.Bar
MJ>  add a mapping for a file extension to the servlet, looks like this:

MJ> 
MJ> foo
MJ> *.form
MJ> 

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

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

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

MJ> --mikej
MJ> -=-
MJ> mike jackson
MJ> [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:
>> 
>>
>>


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



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




Re: Re[2]: calling servlets from jsp

2002-06-20 Thread Brendan . Richards



You need to setup C:\tomcat401\webapps\ROOT\WEB-INF\web.xml to map a url to
the servlet class.

look at webapps\examples\WEB-INF\web.xml for examples.

Once you can actually view the servlet's output in a browser, through the
mapped url you can link to it like any other web file.

ie
onclick="window.location='http://localhost:8080/ServletName'"




---


Hello Brendan,

The path to my servlet is: "C:
\tomcat401\webapps\ROOT\WEB-INF\classes\qc\achizitii"
My servlet is called "Tiparire.class"
The path for my jsp pages is: "C:\tomcat401\webapps\ROOT\qc\achizitii"
My tomcat server is running on port 80
My servlet is working, i'm sure.
How can i call my servlet from a jsp page ?

Alex.

Thursday, June 20, 2002, 7:29:42 PM, you wrote:



BRlc> Can you run the servlet in the first place?

BRlc> for example using a URL such as this:

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

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

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

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


BRlc> Brendan



BRlc> -

BRlc> Hello,

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

BRlc>  Thanks in advance...
BRlc>  Alex.



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




BRlc> --
BRlc> To unsubscribe, e-mail:

BRlc> For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:





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