cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Location of java servlet (not jsp) deployed on Java Stack

Former Member
0 Likes
901

Hello,

Why this forum? this post is related to the way of calling a java servlet deployed on the java stack, so it's related to the structure of the stack than to real java programming.

Usually, I develop JSP servlets which are easily called either with a mapping or not. I have deployed now a java servlet and added a mapping to it by modifying the xml source itselft in its descriptor, but after deployement I am not able to reach the resource.

In the windows explorer of the java stack I find in j2ee>cluster>server>apps my application as follows:

app_ear>servlet_jsp>app>root>WEB-INF>classes>my class files

app_ear>servlet_jsp>app>root>app.jsp

This time it's not a jsp that I want to call: app/app.jsp but my java servlet which lies in the classes subdir.

Could someone help my to achieve this or is it the wrong way, we can only request jsp applications?

Kind regards,

Tanguy Mezzano

View Entire Topic
former_member185706
Participant
0 Likes

Hi Tanguy,

you have mapped unexisting servlet to "/SSOredirect3" url-pattern.

I assume that you need to map SSORedirect3.jsp servlet , previously declared.

So the corrected tags should look like :

<servlet>
		<servlet-name>SSORedirect3.jsp</servlet-name>
		<jsp-file>/SSORedirect3.jsp</jsp-file>
	</servlet>
	<servlet-mapping>
		<servlet-name>SSORedirect3.jsp</servlet-name>
		<url-pattern>/SSOredirect3</url-pattern>
	</servlet-mapping>

This way when you request http://host:port/SSOredirect3 it should be imvoked SSORedirect3.jsp servlet.

Best Regards

Bojidar

Former Member
0 Likes

Hello,

no, I don't want to map my jsp, I want to map my Authenticator java class which is not a jsp.

Vlado
Product and Topic Expert
Product and Topic Expert
0 Likes

OK, but then you should declare this class as a servlet:


	<servlet>
		<servlet-name>AuthenticatorServlet</servlet-name>
		<servlet-class>x.y.z.Authenticator</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>AuthenticatorServlet</servlet-name>
		<url-pattern>/SSOredirect3</url-pattern>
	</servlet-mapping>

HTH!

\-- Vladimir

Former Member
0 Likes

Hello Vladimir,

yes I forgot to add my servlet to the web.xml file.

This works perfectly now!

Thx a lot,

Tanguy Mezzano