Discussion:
Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error -HELP-ME-PLEASE
Korakaki Stella
2002-03-28 12:38:55 UTC
Permalink
When I'm trying to execute the following servlet from the web browser:
---------------------------------------------------------------------

import com.sap.mw.jco.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class Login2 extends HttpServlet
{

JCO.Client mConnection;
JCO.Repository mRepository;

public JCO.Function createFunction(String name) throws Exception {
try {
IFunctionTemplate ft =
mRepository.getFunctionTemplate(name.toUpperCase());
if (ft == null)
return null;
return ft.getFunction();
}
catch (Exception ex) {
throw new Exception("Problem retrieving JCO.Function object.");
}
}

public void doGet (HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
{

res.setContentType("text/html");
PrintWriter out = res.getWriter();
String tmp;

out.println("<html><body>");

try {
// Change the logon information to your own system/user
mConnection =
JCO.createClient("300", // SAP client
"username", // userid
"********", // password
"EN", // language
"127.0.0.1", // application server host name
"00"); // system number
mConnection.connect();
mRepository = new JCO.Repository("ARAsoft", mConnection);
}
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}

JCO.Function function = null;
JCO.Table codes = null;
try {
function = this.createFunction("ZRFC_CUSTOMERS");
if (function == null) {
System.out.println("ZRFC_CUSTOMERS" +
" not found in SAP.");
System.exit(1);
}

JCO.ParameterList input=function.getImportParameterList();
input.setValue("0001","BUKRS");

mConnection.execute(function);

codes =
function.getTableParameterList().getTable("CUSTOMER");
for (int i = 0; i < codes.getNumRows(); i++) {
codes.setRow(i);

tmp=codes.getString("NAME1");
if (tmp.length() < 12 ) { out.println("<li>");out.println(tmp);}
else {out.println("<li>");out.println(tmp.substring(0,12));}
}
}
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}
out.println("</body></html>");

mConnection.disconnect();

}
}
--------------------------------------
The following message is displayed :
--------------------------------------
Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error

type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server
Error) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Invoker service() exception
at
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:504)
at
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)

root cause

java.lang.NoClassDefFoundError
at Login2.doGet(Login2.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:446)
at
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)

---------------------------------------------------------
Could someone tell me what is wrong ?
Please help me !!!!!!!!!!
--------------------------------------------------------




--------------------
Stella Korakaki
Koutoudis Consulting


--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
Randy Layman
2002-03-28 11:58:56 UTC
Permalink
-----Original Message-----
Sent: Thursday, March 28, 2002 7:39 AM
To: Tomcat Users List
Subject: Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
-HELP-ME-PLEASE
java.lang.NoClassDefFoundError
at Login2.doGet(Login2.java:51)
at
---------------------------------------------------------
Could someone tell me what is wrong ?
Please help me !!!!!!!!!!
--------------------------------------------------------
Whatever class you are trying to load on line 51 of Login2.java is
not available to Tomcat.

Randy

--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
Randy Layman
2002-03-28 12:22:10 UTC
Permalink
A few questions to remove the obvious:
1. Have you restarted Tomcat after copying the jco.jar file?
2. Does the jco.jar file really have a file /com/..../jco.class?
3. Does Tomcat have permissions to read this file (more of an issue
on Unix, but possible on windows)?
4. Can you run jar -xvf jco.jar to extract the jar file?
5. Have you tried putting the jar fine in the WEB-INF/lib directory
to see if it works there?
6. Is Tomcat printing any error message (to catalina.log or the
console) during startup that might indicate its not loading this jar?

That's all I can think of right now. Try these and see if anything
pops up, if not post back and I'll try another round.

Randy
-----Original Message-----
Sent: Thursday, March 28, 2002 7:59 AM
To: Tomcat Users List
Subject: RE: Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server
Error -HELP-ME-PLEASE
Thanx Randy but I've placed my jar file with the classes needed at
$CATALINA_HOME/common/lib/jCO.jar . This is not enough ?
Stella
Post by Randy Layman
-----Original Message-----
Sent: Thursday, March 28, 2002 7:39 AM
To: Tomcat Users List
Subject: Apache Tomcat/4.0.3 - HTTP Status 500 - Internal
Server Error
Post by Randy Layman
-HELP-ME-PLEASE
java.lang.NoClassDefFoundError
at Login2.doGet(Login2.java:51)
at
---------------------------------------------------------
Could someone tell me what is wrong ?
Please help me !!!!!!!!!!
--------------------------------------------------------
Whatever class you are trying to load on line 51 of
Login2.java is
Post by Randy Layman
not available to Tomcat.
Randy
--
--------------------
Stella Korakaki
Koutoudis Consulting
--
--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
Chapman, Carl
2002-03-28 17:56:25 UTC
Permalink
So it executed the Servlet Login2 as evidence in the stacktrace....
Post by Korakaki Stella
root cause
java.lang.NoClassDefFoundError
at Login2.doGet(Login2.java:51)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
... and it got all the way to line 51. It looks like there are other
classes from this jar package that are being invoked. If they are being
invoked with no exception then the jar file is found. But the class at line
51 is not found. My line counting isn't working so you need to point to the
source code line 51. Also assuming your classes are like this:
com.sap.mw.jco.JCO.Repository and the jco.jar file is in your WEB-INF/lib
directory.
Post by Korakaki Stella
-----Original Message-----
Sent: Thursday, March 28, 2002 4:39 AM
To: Tomcat Users List
Subject: Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
-HELP-ME-PLEASE
When I'm trying to execute the following servlet from the
---------------------------------------------------------------------
import com.sap.mw.jco.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Login2 extends HttpServlet
{
JCO.Client mConnection;
JCO.Repository mRepository;
public JCO.Function createFunction(String name) throws Exception {
try {
IFunctionTemplate ft =
mRepository.getFunctionTemplate(name.toUpperCase());
if (ft == null)
return null;
return ft.getFunction();
}
catch (Exception ex) {
throw new Exception("Problem retrieving JCO.Function object.");
}
}
public void doGet (HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
{
res.setContentType("text/html");
PrintWriter out = res.getWriter();
String tmp;
out.println("<html><body>");
try {
// Change the logon information to your own system/user
mConnection =
JCO.createClient("300", // SAP client
"username", // userid
"********", // password
"EN", // language
"127.0.0.1", // application server host name
"00"); // system number
mConnection.connect();
mRepository = new JCO.Repository("ARAsoft", mConnection);
}
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}
JCO.Function function = null;
JCO.Table codes = null;
try {
function = this.createFunction("ZRFC_CUSTOMERS");
if (function == null) {
System.out.println("ZRFC_CUSTOMERS" +
" not found in SAP.");
System.exit(1);
}
JCO.ParameterList input=function.getImportParameterList();
input.setValue("0001","BUKRS");
mConnection.execute(function);
codes =
function.getTableParameterList().getTable("CUSTOMER");
for (int i = 0; i < codes.getNumRows(); i++) {
codes.setRow(i);
tmp=codes.getString("NAME1");
if (tmp.length() < 12 ) {
out.println("<li>");out.println(tmp);}
else {out.println("<li>");out.println(tmp.substring(0,12));}
}
}
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}
out.println("</body></html>");
mConnection.disconnect();
}
}
--------------------------------------
--------------------
Stella Korakaki
Koutoudis Consulting
--
--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
Chuck Amadi
2002-04-05 11:41:32 UTC
Permalink
Hi Korakaki Stella

Plz could you work out wats with this .

Note that a few days's ago my Planning Database Project was working fine
until now.

Regards Chuck Amadi

*type* Exception report

*message*_Internal Server Error_

*description*_The server encountered an internal error (Internal Server
Error) that prevented it from fulfilling this request._

*exception*

javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:653)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:484)

*root cause*

java.lang.NoSuchMethodError
at org.apache.jasper.compiler.TldLocationsCache.processJars(TldLocationsCache.java:202)
at org.apache.jasper.compiler.TldLocationsCache.(TldLocationsCache.java:139)
at org.apache.jasper.EmbededServletOptions.(EmbededServletOptions.java:345)
at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:916)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:653)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:484)





--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
Timothy Fisher
2002-04-05 18:44:36 UTC
Permalink
Can someone tell me how to accomplish the following:

I am using form-based authentication.

Lets assume the following files exist:
- login.html
- home.html
- page1.html

Both home.html and page1.html are protected so the
user is redirected to the login page if trying to
access those.

Now after a successful form-based login, I want the
user to ALWAYS be routed to the home.html page, not
necessarily the page he was implicitly trying to
access.

For example if he trys to access page1.html, he will
be redirected to login.html. Upon successful
authentication, I want him to be redirected to
home.html.

I know this can be done. Just dont remember how.


Sincerely,
Timothy Fisher


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
Jason Owens
2002-04-05 19:09:57 UTC
Permalink
As far as I know - you cannot do this while using the default
container-based form authentication. Tomcat's form authenticator stores
the original request, and then redirects to it once the user is
authenticated. In other words, you'd have to override tomcat's default
behavior. (This is the same kind of problem I've been having...)

If you need to do that, you might have to subclass FormAuthenticator.
However, I'm not sure how to tell Tomcat to use your class... Maybe
someone else knows?

-Jason
Post by Timothy Fisher
I am using form-based authentication.
- login.html
- home.html
- page1.html
Both home.html and page1.html are protected so the
user is redirected to the login page if trying to
access those.
Now after a successful form-based login, I want the
user to ALWAYS be routed to the home.html page, not
necessarily the page he was implicitly trying to
access.
For example if he trys to access page1.html, he will
be redirected to login.html. Upon successful
authentication, I want him to be redirected to
home.html.
I know this can be done. Just dont remember how.
Sincerely,
Timothy Fisher
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
Alvin Wang
2002-04-05 19:54:03 UTC
Permalink
Timothy, can you use a filter to do this? In your homepage, you set a tag in
session. If the filter finds this tag, that means the homepage has been
visited, otherwise the user will be redirected to the homepage

Alvin

-----Original Message-----
From: Timothy Fisher [mailto:***@yahoo.com]
Sent: Friday, April 05, 2002 1:45 PM
To: Tomcat Users List
Subject: Redirecting to a home page after form-based authentication


Can someone tell me how to accomplish the following:

I am using form-based authentication.

Lets assume the following files exist:
- login.html
- home.html
- page1.html

Both home.html and page1.html are protected so the
user is redirected to the login page if trying to
access those.

Now after a successful form-based login, I want the
user to ALWAYS be routed to the home.html page, not
necessarily the page he was implicitly trying to
access.

For example if he trys to access page1.html, he will
be redirected to login.html. Upon successful
authentication, I want him to be redirected to
home.html.

I know this can be done. Just dont remember how.


Sincerely,
Timothy Fisher


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>


--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
Timothy Fisher
2002-04-05 20:47:26 UTC
Permalink
Good point, but I was hoping to find a solution that
would be compatible across a variety of app servers.
Most commercial app servers do not yet support
filters, as they are part of the 2.3 servlet spec.

Tim
Post by Alvin Wang
Timothy, can you use a filter to do this? In your
homepage, you set a tag in
session. If the filter finds this tag, that means
the homepage has been
visited, otherwise the user will be redirected to
the homepage
Alvin
-----Original Message-----
Sent: Friday, April 05, 2002 1:45 PM
To: Tomcat Users List
Subject: Redirecting to a home page after form-based
authentication
I am using form-based authentication.
- login.html
- home.html
- page1.html
Both home.html and page1.html are protected so the
user is redirected to the login page if trying to
access those.
Now after a successful form-based login, I want the
user to ALWAYS be routed to the home.html page, not
necessarily the page he was implicitly trying to
access.
For example if he trys to access page1.html, he will
be redirected to login.html. Upon successful
authentication, I want him to be redirected to
home.html.
I know this can be done. Just dont remember how.
Sincerely,
Timothy Fisher
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
--
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
s***@halcyon.com
2002-04-05 19:04:46 UTC
Permalink
How about this?

String s = "/home.html";
RequestDispatcher disp = getServletContext().getRequestDispatcher(someaddress);
dispatcher.forward(request,response)
Post by Timothy Fisher
I want him to be redirected to
home.html.
--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
Timothy Fisher
2002-04-05 19:06:36 UTC
Permalink
Where are you suggesting that code go?

You don't want to forward from the login page, because
the form on that page is submitted to j_securitycheck.

Tim
Post by s***@halcyon.com
How about this?
String s = "/home.html";
RequestDispatcher disp =
getServletContext().getRequestDispatcher(someaddress);
Post by s***@halcyon.com
dispatcher.forward(request,response)
Post by Timothy Fisher
I want him to be redirected to
home.html.
--
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe: <mailto:tomcat-user-***@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-***@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-***@jakarta.apache.org>
Loading...