Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

j_security_check

Former Member
0 Kudos

Hi,

Would anyone please be able to shed light on the following:

When a web-application uses "j_security_check" , where does it store the name of the original page requested by the user (the one to which user should be redirected after a successful login ) ?

5 REPLIES 5

martin_voros
Active Contributor
0 Kudos

Hi,

I am not 100% about SAP but application server usually creates a HTTP session object and stores it there. Check this non SAP [example|http://roneiv.wordpress.com/2008/02/18/jaas-authentication-mechanism-is-it-possible-to-force-j_security_check-to-go-to-a-specific-page/].

Cheers

0 Kudos

Do you know another method to check the password and the username???

0 Kudos

What is you problem with j_security_check?

Cheers

0 Kudos

Hi Martin

j_security_check doesn't work.

0 Kudos

Hello

I have literally just set this up myself and it is working.

What I did was to create a redirect.jsp that contains the path that wanted to redirect to eg.

<%@ page language="java" %>
<%@ page import = "java.net.URLEncoder" %>
<%
	String redirectURL = "";

	// Check if GET Parameter "redirectURL" is availabel
	redirectURL = request.getParameter ("redirectURL");
	if (redirectURL != null) {
				response.sendRedirect ("http://" + redirectURL);
	} else {
				response.sendRedirect ("/irj/portal/HR/HR");
	}
%>

In my web.xml I created a "Servlet Mapping" to "redirect.jsp" with URL pattern "/"

Logon form as follows:

<%@ page language = "java"%>
<html>
	<head>
		<title>
			Login Redirect
		</title>
	</head>
	<body>
	<TABLE WIDTH=500>
		<TR>
		<TD>

		<FORM name="logonForm" method="post" action="j_security_check">  
		  <input name="login_submit" type="hidden" value="on">
		  <input type="hidden" name="login_do_redirect" value="1"/>
		  <input name="j_authscheme" type="hidden" value="default">
				<p>Please enter Username and Password:</p>
				<table border="0">
					<tr>
						<td><p>Username</p></td>
						<td><input type="text" name="j_username" id="j_username"</td>
					</tr>
					<tr>	
						<td><p>Password</p></td>
						<td><input type="password" name="j_password" id="j_password"</td>
					</tr>
					<tr>
						<td> </td>
						<td><input type="submit" name="submit" value="Login" </td>		
					</tr>
				</table>
		</form>
		</TD>
		</TR>
	</TABLE>
	</body>
</html>