Java Servlet Question

Wingy

[H]ard|Gawd
Joined
Dec 18, 2000
Messages
1,294
I have a servlet I've written called PageView, which will display the proper JSP based on a page parameter. (ie. http://localhost:8080/FCMS/PageView?page=index shows the index page.)

I know FCMS is the name of the application. I would like to set up my Servlet Container (Resin 3.0.24) to have http://localhost:8080/ be mapped to the FCMS/PageView?name=index
servlet. How can I do this?? Or do I have to make up an index.jsp that invokes the servlet explicitly?
 
I haven't tried this and I'm not 100% sure it'll work. But, you could try adding this to your web.xml

<welcome-file-list>
<welcome-file>FCMS/PageView?name=index</welcome-file>
</welcome-file-list>
 
I have a servlet I've written called PageView, which will display the proper JSP based on a page parameter. (ie. http://localhost:8080/FCMS/PageView?page=index shows the index page.)

I know FCMS is the name of the application. I would like to set up my Servlet Container (Resin 3.0.24) to have http://localhost:8080/ be mapped to the FCMS/PageView?name=index
servlet. How can I do this?? Or do I have to make up an index.jsp that invokes the servlet explicitly?

ahm. We cannot see your links. Localhost is your machine. :cool:
 
I attempted this... Didnt seem to work, although I tried it quickly with adding it to the additional welcome pages.

Now I wonder, do you default the application to the servlet as a welcome page, then default the server to an application?

Thanks for your input. I wondered about the XML welcome page thing, and I'm glad you pointed it out. I dont think it's my solution tho.

EDIT: I also tried mapping the PageView servlet to "/", and that also didnt seem to give the results I was looking for.

It seems to me there should be a standard way of doing such a thing.
 
ahm. We cannot see your links. Localhost is your machine. :cool:

I realize that, I was giving those as examples of the links I was using in my dev. Had they been on an actual webserver you could access, you would not have been able to see any relevant code anyhow.

This is a generic servlet container issue
 
I'm not sure I've run into that term before. My guess would be no since I dont know what what it means ha

Could you elaborate?
Thanks
 
Sorry for the delay..

In Resin (from reading the docs), there are two directories that contains web applications. One is called ROOT, which is a special application that's used when you access "/" (or /index.(html|jsp) etc). Other web applications are deployed in the webapps directory. You can read the docs here [1].

I suppose you have two options. You could either deploy your application to the ROOT application (I don't know if this will work.. basically, rename the old ROOT folder, and rename yours to ROOT and drop it into the correct directory). In that case, you'll have to map your servlet to /FCMS/*. Your other option is to edit the index.(html|jsp) that's inside the ROOT web application to redirect the browser to the correct URL.


[1] http://www.caucho.com/resin/doc/webapp-overview.xtp
 
Back
Top