aspose file tools*
The moose likes Servlets and the fly likes pointing to second project's class file in first project's web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "pointing to second project Watch "pointing to second project New topic
Author

pointing to second project's class file in first project's web.xml

prateek sharmaa
Ranch Hand

Joined: May 15, 2010
Posts: 38
Hi all,
This question may sound stupid but I am stuck at it.

I have two projects in my workspace.
(1) core
(2) web

I have created a servlet in core project with name ShowDashboardServlet.java
In my web project I want to configure web.xml to point to TestServlet.java

Below mapping is done in web project's web.xml.



I want to do this because we want the URL to look like /web/dashboard/myproject and not /core/dashboard/myproject
and I can not put the servlet in web project as there are no servlet related jars available and few more jars that I use in the servlet are missing in web project.

so my restriction is that i need to keep the servlet in core folder and need to configure it in web project.

can I do this?
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3168
    
  47

prateek sharmaa wrote:
so my restriction is that i need to keep the servlet in core folder and need to configure it in web project. can I do this?


No, unless you bundle all required dependencies of the core project in to a jar file and use it in the web project. I don't see what you are trying to accomplish with this sort of architecture. If you can elaborate your real need, we can be more helpful.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

It just sounds like a bad design all around. You should take a few steps back and reevaluate this approach.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: pointing to second project's class file in first project's web.xml