tags:

views:

123

answers:

1

Hi I have a J2EE application which is working and I has the basic structure as

APP

|____login.jsp

|____   other files/directories      (several other directories and files required)

|____WEB-INF

     |__classes
             |__top
                |___web     (has more sub directories with class files)
|
______NewDir

      |__login2.jsp

I want to add another directory as shown above NewDir which would have a similar login.jsp as the one int he root directory which uses some classes in com.top.web. etc and the login.jsp uses those at the top of the page in the following manner.

<%@ include file="includes/utf8.jsp"%>

<%@ page import = "com.top.app.login.LoginBean" %>
<%@ page import = "com.top.app.login.*" %>
<%@ page import = "javax.servlet.http.Cookie" %>
<%@ page import = "org.apache.commons.logging.Log" %>
<%@ page import = "org.apache.commons.logging.LogFactory" %>

<jsp:useBean id="bean" scope="session" class="com.top.app.login.LoginBean"/>

The quesiton I have is when I create that directory I need to change the above imports because obvisoulsy its not going to find those classes. How would this login2.jsp find those classes inside com.top.web... ?

Also what about the useBean? How would that also be found?

+1  A: 

Why do you think it won't find them?

The classes referenced by the jsp must be in the classpath. And the classpath includes WEB-INF/classes. The location of the jsp is of no importance.

Bozho
thea reason i feel its not finding it is that the moment i mmake a copy of this login.jsp to NewDir and try to access it, it throws a 500 internal server error.
go check the log files (tomcat_home/logs) and see what's the exact reason
Bozho
ua re right it always pics up stuff from WEB_INF as it is in class path. thanks for your help. The issue was something else with the redirect.