cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute deployed servlet.

Former Member
0 Kudos

Hello,

I've successfully deployed a servlet to the J2EE engine on a server (not locally) but now I'm stuck on how to execute it.

Here's what I've done.

1-Created a new Web Module Project called TestServlets

2-Created a new servlet called SimpleSerlvet.java in the new project.

3-Created a war file for Web Module project

4-Created a new Enterprise Application project called "FirstEnterpriseApplicationProject"

5-Built an Application Archive for the enterprise application project.

6-Deployed the ear file to the J2EE engine on the server

The deploy output view showed the deploy as finishing with no problems.

HOwever, now that it's deployed out there I don't know how to execute it.

I've tried all kinds of combinations starting with

http://servername:50000/ but none of them work.

Can anyone tell me or point me to documentation that shows how to execute a servlet on the server in the situation I've described?

Thanks in advance for any help.

David

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi David,

to request your servlet, you need to execute the following URL:

http://<host>:<HTTP_port>/<contextRoot>/servlet/<serlvet_name>;

where

<contextRoot> is the value of the <context-root> tag for your WAR file in the application.xml file. If you have not explicitly specified the context root (as you never mentioned that in your original post), the default value that the Developer Studio uses is /contextRoot.

<servlet_name> is the value of the <servlet-name> tag for your servlet in the web.xml (in your case this should be SimpleServlet).

In case you have specified a servlet mapping for your servlet in your web.xml, you can also call this servlet using the following URL: http://<host>:<port>/<contextRoot>/<servlet_mapping_pattern>.

The following topics in the documentation might help you:

http://help.sap.com/saphelp_nw04/helpdata/en/b6/e8b48a76b17b449c07cb5edbdf152b/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/a5/256550f9671644b496d0df25633355/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/60/ca7aa22ddc5d4f8f4704ec207198ce/frameset.htm

Hope that helps!

Former Member
0 Kudos

Ivaylo,

Thanks much for your reply. That was very helpful information. Although it didn't totally solve my problem it definitely led me on the right path and I was able to figure it out.

I've tried so many things that I'm not sure exactly which one fixed it so I'm going to go through the exercise again from scratch.

however I think that what finally made it work was that I specified a context instead of using the default one and created a mapping for the servlet.

Thanks Much!

David.

Answers (0)