Just tried it and it did.
I don't know what I did different other than step away from it for a bit. 
It works exactly the way I want it to.

Thanks so much!

    Dave Reiher
    System Analyst
    Prairie Farms Dairy - Corporate
    Ph: 217.854.2547 ext. 254
    dreiher@xxxxxxxxxxxxxxxx



"Haas, Matt" <Matt.Haas@xxxxxxxxxxx> 
Sent by: web400-bounces@xxxxxxxxxxxx
09/07/2005 11:01 AM
Please respond to
Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>


To
"Web Enabling the AS400 / iSeries" <web400@xxxxxxxxxxxx>
cc

Subject
RE: [WEB400] Redirect JSP






If you're protecting it with basic auth, request.getRemoteUser() will
return the user name they typed in.

Matt 

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Dave Reiher/prairiefarms
Sent: Wednesday, September 07, 2005 11:38 AM
To: Web Enabling the AS400 / iSeries
Subject: RE: [WEB400] Redirect JSP

Matt,

Basically I want to have a Login.jsp like this:
<%
HttpSession  mySession  = request.getSession(false);
// get user_id
String suserID = request.getParameter( "username" );
// put values on the session to send them on screen
mySession.setAttribute("username",suserID);
//mySession.setAttribute("username","Reiher");
//redirect to screen
response.sendRedirect("LoginScreen.jsp?username=" + 
mySession.getAttribute("username"));
%>

This sits in a location protected by Basic Auth. using a validation
list. 
I was hoping that request.getParameter("username") would grab the
username 
entered in the validation list dialog box and I could use it to pass
them 
on to the URL. Does that make sense??
Sorry, a little green with java

    Dave Reiher
    System Analyst
    Prairie Farms Dairy - Corporate
    Ph: 217.854.2547 ext. 254
    dreiher@xxxxxxxxxxxxxxxx



"Haas, Matt" <Matt.Haas@xxxxxxxxxxx> 
Sent by: web400-bounces@xxxxxxxxxxxx
09/07/2005 09:59 AM
Please respond to
Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>


To
"Web Enabling the AS400 / iSeries" <web400@xxxxxxxxxxxx>
cc

Subject
RE: [WEB400] Redirect JSP






I'm not following what you're doing (I understand what you want to do).
I did a similar thing not too long ago. What I have is:

- A JSP for user name/password entry
- A servlet to process the form. If it passed validation, I do a
redirect to a URL otherwise, I do a forward back to the JSP page to show
error messages.

If you're doing all of this in the JSP, you should have access to a
response object.

One error that I see now that I've taken another look at this is that
request.getRemoteUser() isn't going to return anything (you'll probably
get 'null' returned) unless you password protect the JSP (and servlet if
you're using one) using basic authentication which makes this redundant.

Matt

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Dave Reiher/prairiefarms
Sent: Wednesday, September 07, 2005 10:20 AM
To: Web Enabling the AS400 / iSeries
Subject: RE: [WEB400] Redirect JSP

Sorry about that, it does look confusing now that you say that. However,

WEB is the host name, some genious decided to call it that. Basically I 
could take that URL and the value of request.getRemoteUser and go right
to 
the URL. I am doing something wrong though, because WS doesn't like the 
way I am doing it......

    Dave Reiher
    System Analyst
    Prairie Farms Dairy - Corporate
    Ph: 217.854.2547 ext. 254
    dreiher@xxxxxxxxxxxxxxxx



"Haas, Matt" <Matt.Haas@xxxxxxxxxxx> 
Sent by: web400-bounces@xxxxxxxxxxxx
09/07/2005 09:03 AM
Please respond to
Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>


To
"Web Enabling the AS400 / iSeries" <web400@xxxxxxxxxxxx>
cc

Subject
RE: [WEB400] Redirect JSP






You either need to send them to a full URL with the host name (which
you're missing) or to a relative URL. Basically, the redirect URL has to
be something that you could put in a web page as a hyperlink.

Matt 

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Dave Reiher/prairiefarms
Sent: Wednesday, September 07, 2005 9:21 AM
To: web400@xxxxxxxxxxxx
Subject: [WEB400] Redirect JSP

I want to have a jsp page that I can use just for authenticating users
and 
then if valid redirect them to a URL built using the username they 
entered. Something like this
String redirectURL = "http://WEB/TEST/WFInvocation.do?inv=INV1&&USR="; + 
request.getRemoteUser;
response.sendRedirect(redirectURL);
Only thing I run into right now is that in WebSphere "request" is not 
known or valid. Or I am not doing it correctly. Any suggestions???
 
Thanks!
Dave Reiher
System Analyst
Prairie Farms Dairy - Corporate
Ph: 217.854.2547 ext. 254
dreiher@xxxxxxxxxxxxxxxx

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.