Weblogic 10 jaas and login.jsp and web.xml/weblogic.xml security constaints

Hello,
I struggled through and got the examples.security.jaas.SampleCallbackHandler.java and examples.common.utils.ExampleUtils.java/ExampleConstants.java into eclipse where they compile. A bean I made can call SambleCallbackHandler like such:
mybean.logmein(username,password,url). I can then do a mybean.getStatus() or even a mybean.returnCode(). It does seem to correctly identlify that it is authenticating me (I see in stdout logs that it shows success or failures. The problem I have is I do not know how to apply this weblogic and web.xml/weblogic.xml so that if authentication works it redirects me to the page requiring the authentication. In web.xml I have the following set up:
<security-role>
     <role-name>Admins</role-name>
</security-role>
<login-config>
     <auth-method>FORM</auth-method>
     <realm-name>default</realm-name>
     <form-login-config>
          <form-login-page>/login.jsp</form-login-page>
          <form-error-page>/badlogin.html</form-error-page>
     </form-login-config>
</login-config>
<security-constraint>
     <web-resource-collection>
          <web-resource-name>empower</web-resource-name>
          <description>These pages are only accessible by authorized users.</description>
          <url-pattern>/admin/*</url-pattern>
          <http-method>GET</http-method>
          <http-method>POST</http-method>
     </web-resource-collection>
<auth-constraint>
<description>These are the roles who have access</description>
<role-name>Administrators</role-name>
</auth-constraint>
     <user-data-constraint>
     <description>This is how the user data must be transmitted</description>
     <transport-guarantee>NONE</transport-guarantee>
     </user-data-constraint>
</security-constraint>
My weblogic.xml has:
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
<wls:security-role-assignment>
<wls:role-name>Admins</wls:role-name>
<wls:principal-name>Administrators</wls:principal-name>
<wls:principal-name>dashap</wls:principal-name>
</wls:security-role-assignment>
</wls:weblogic-web-app>
With this set up, if I try to go to a page in /admin folder in my application, it correctly pops up the login page. The jaas in the bean is doing a loginContext.login(), which I thought does authentication too, but it never goes back to the /admin page I was going to that needed the authentication. With jaas, can I not use the web.xml FORM security option? Do I Need to use j_security in the login.jsp's form's action= option and j_username and j_password for the input type names? How do I use j_username/j_password things if I am using jaas? I could just ignore using the web.xml security stuff and put something in the pages that need authentication, but it would be easier if I could use jaas with the security featurs without doing all that. Note that my code above is using a realm called default just because that was what was in the example I got from the web. Does that need to be something else?

Hi John,
I would like magic of course. However, in this case I want something special: my authentication provider uses special means and contents of headers, cookies and service from external identity management systems to determine the user's identity.
I do not want the application to present the login dialog! I want to derive the identity and the fact that the user is logged in from whatever the authentication provider returns in terms of Subject.
Ideally, the flow is something like:
- user accesses an unprotected resource - resource is shown, no interaction with authentication provider
- user presses a link or button that takes him/her to a protected resource
- the authentication provider is contacted to work with the identity asserter to establish the identity of the current user and create a subject object for this user
- the application can access the subject and principals
- ADF Security recognizes the identity and the roles (based on the principals) and coordinates access based on this.
the authentication method is client certificate. presumably this prompts WebLogic/OPS to use an identity asserter to work with custom headers and cookies ("... when you configure a web application to use CLIENT-CERT authentication. In this case, WebLogic can perform identity assertion based on values from request headers and cookies. If the header name or cookie name matches the active token type for the provider, the value is passed to the provider."). No login form should be presented to the user, as all information required to perform the authentication is already available.
I am trying to understand what I must do to have the ADF application adopt the subject set by the authentication provider - if anything?!
If you more ideas to share - I would love to hear them.
best regards,
Lucas

Similar Messages

  • Writing Login.jsp and authenticating a user who have stored in MySql DB

    Hi Friends,
    My project requirement is: Need to write a login page must send the request to servlet is the user and password avail in mysql db, if yes servlet should forward the home page else error message. Tools i need to use is IDE=eclipse, Server = tomcat, database = MySql
    Here is source:
    pls tell me where i m wrong.
    Login.jsp
    <%@ page language="java" %>
    <html>
    <head>
    <title>Login Page</title>
    <script language = "Javascript">
    function Validate(){
    var user=document.frm.user
    var pass=document.frm.pass
    if ((user.value==null)||(user.value=="")){
    alert("Please Enter user name")
    user.focus()
    return false
    if ((pass.value==null)||(pass.value=="")){
    alert("Please Enter password")
    pass.focus()
    return false
    return true
    </script>
    </head>
    <body>
    <h1>Login
    <br>
    </h1>
    <form name="frm" action="/LoginAuthentication" method="Post" onSubmit="return Validate()" >
    Name:
    <input type="text" name="user" value=""/><br>
    Password:<input type="password" name="pass" value=""/><br>
    <br>
    <input type="submit" value="Login" />
    <input type="reset" value="forgot Password" />
    </form>
    </body>
    </html>
    Servlet Code:
    LoginAuthentication.java
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.ServletContext;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.util.List;
    import java.util.ArrayList;
    public class LoginAuthentication extends HttpServlet{
    private ServletConfig config;
    public void init(ServletConfig config)
    throws ServletException{
    this.config=config;
    //public void init() {
    // Normally you would load the prices from a database.
    //ServletContext ctx = getServletContext();
    // RequestDispatcher dispatcher = ctx.getRequestDispatcher("/HomePage.jsp");
    //dispatcher.forward(req, res);
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException,IOException{
    PrintWriter out = response.getWriter();
    String connectionURL = "jdbc:mysql://127.0.0.1/SRAT";
    //String connectionURL = "jdbc:mysql://192.168.10.59/SRAT";
    //127.0.0.1
    //http://localhost:3306/mysql
    Connection connection=null;
    ResultSet rs;
    String userName=new String("");
    String passwrd=new String("");
    response.setContentType("text/html");
    try {
    // Load the database driver
    Class.forName("com.mysql.jdbc.Driver");
    // Get a Connection to the database
    connection = DriverManager.getConnection(connectionURL, "admin", "admin");
    //Add the data into the database
    String sql = "select user,password from login";
    Statement s = connection.createStatement();
    s.executeQuery (sql);
    rs = s.getResultSet();
    while (rs.next ()){
    userName=rs.getString("user");
    passwrd=rs.getString("password");
    rs.close ();
    s.close ();
    }catch(Exception e){
    System.out.println("Exception is ;"+e);
    if(userName.equals(request.getParameter("user"))
    && passwrd.equals(request.getParameter("pass"))){
    out.println("WELCOME "+userName);
    else{
    out.println("Please enter correct username and password");
    out.println("<a href='Login.jsp'><br>Login again</a>");
    Deployment Descriptor for TOMCAT
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>
    SRAT</display-name>
    <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
    <servlet-name>LoginAuthentication</servlet-name>
    <servlet-class>LoginAuthentication</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>LoginAuthentication</servlet-name>
    <url-pattern>/LoginAuthentication</url-pattern>
    </servlet-mapping>
    </web-app>
    PLS HELP ME.
    S. Udaya Chandrika

    I too have used the same code but its giving the following error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Wrapper cannot find servlet class Validation or a class it depends on
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
         org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         java.lang.Thread.run(Unknown Source)
    root cause
    java.lang.ClassNotFoundException: Validation
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
         org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         java.lang.Thread.run(Unknown Source)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
    Apache Tomcat/6.0.18
    Please some one help??

  • Jdeveloper ADF and Login.jsp

    I would like to change the default login.html to be a login.jsp page so I can format the page better and still use the authen/author used by login.html
    Does some have a sample login.jspx that does the same a login.html.
    Thanks

    Hi Rac Man,
    The following URLs can be useful:
    http://www.radio21g.com/faces/2007/07/24/adf-faces-for-dummies-22-create-your-hello-world-app-continued/
    http://download.oracle.com/docs/cd/E12529_01/webcenter.1013/b31072/tt_security.htm#CHDCIIHE
    http://blogs.oracle.com/shay/entry/for_some_reason_one_common
    http://www.nyoug.org/Presentations/2010/June/Koletzke_Hello_WWW.pdf
    Regards,
    Cris

  • Lost Tomcat, its database and all JSP and HTML files

    I have mistakably uninstalled Tomcat from my machine, it removed the data I stored in the root including HTML and JSP files, I am using windows XP, Is there any way I can recover htem back, atlest the database and the JSP files? please Help

    Also a good example of why you should develop apps in a separate directory structure and then deploy the WAR file to Tomcat.
    You didn't have all your source code under Tomcat, did you?
    You weren't using a source control system like CVS?
    Oh, my. ;)
    You will from now on, I'll bet.
    %

  • How to setup and run JSP project in BEA Weblogic

    i am trying to run my JSP project located in c:\project. i am actually running it in Tomcat webserver, this time i wanna test it in bea weblogic server, i have downloaded a version 8.1, before purchasing the software for development use, i wanna know and test first BEA's integrity and use... my question is how can i set up the base document path that i have in tomcat in bea, so i can just point it to such directory and run it directly using port 7001 for bea weblogic server..
    can anybody help me get tru it step-by-step??
    help please...

    Jason Combras napisa?(a):
    how can i set up the base document path that i have in tomcat in bea, so i can just point it to such directory and run it directly using port 7001 for bea weblogic server..
    can anybody help me get tru it step-by-step??
    help please...Jason,
    Simplest way "in my opinion":
    1. start weblogic Server. You can use Server with examples. This domain
    is already configured, so You will not need any domain configuration tasks.
    2. open weblogic administration console using browser
    http://localhost:7001/console/. Log in.
    3. On the left side choose Deployments -> Web Application Modules
    4. Click "Deploy a new Web Application Module"
    5. Find folder with Your application. Mark it and click Target Module.
    6. Define Application name and click Deploy
    7. If deployed successfully, Your application should be accessible at
    http://localhost:7001/YourApplicationContextRoot
    Best Regards,
    KArol Muszynski

  • First use of jsp and java bean and "Unable to compile class for JSP" error

    Hi,
    I am trying to create my first jsp + java bean and I get a basic error (but I have no clue what it depends on exactly). Tomcat seems to cannot find my class file in the path. Maybe it is because I did not create a web.xml file. Did I forgot to put a line in my jsp file to import my bean?
    Thank you very much for your help.
    Here is my error:
    An error occurred at line: 2 in the jsp file: /login.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    /usr/local/tomcat/jakarta-tomcat-5/build/work/Catalina/localhost/test/org/apache/jsp/login_jsp.java:43: cannot resolve symbol
    symbol : class CMBConnect
    location: class org.apache.jsp.login_jsp
    CMBConnect test = null;
    I only have this in my directory:
    test/login.jsp
    test/WEB-INF/classes/CMBConnect.java
    test/WEB-INF/classes/CMBConnect.class
    Do I need to declare another directory in classes to put my class file in it and package my bean differently?
    Here is my login.jsp:
    <%@ page errorPage="error.jsp" %>
    <jsp:useBean id="test" type="CMBConnect" scope="session" />
    <html>
    <head>
    <title>my test</title>
    </head>
    <body>
    <h3>Login information</h3>
    <b><%=session.getValue("customerinfo.message")%></b>
    <form> ....... </form>
    </body>
    </html>
    and here is my CMBConnect.java:
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class CMBConnect
    public CMBConnect () { }
    public String openConnection(String id, String password) {
    String returnText = "";
    try {
    Connection con = null;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection("jdbc:oracle:thin:@myserver.abc.com:1521:TEST", id, password);
    if(con.isClosed())
    returnText = "Cannot connect to Oracle server using TCP/IP...";
    else
    returnText = "Connection successful";
    } catch (Exception e) { returnText = returnText + e; }
    return returnText;
    Thanks again!

    Thanks for you help
    I created the package and I get this error this time:
    javax.servlet.ServletException: bean test not found within scope
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:822)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:755)
         org.apache.jsp.login_jsp._jspService(login_jsp.java:68)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:268)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:277)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:223)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

  • How to pass login name and password

    Hi all,
    If this question has been asked before, please let me know, and I am sorry for duplicate the question raising.
    I want to use the login name and password which are entered from the left frame(topic frame) in the right frame ( the content frame).
    I have 3 jsp programs, "A.jsp" is for validate the login (name and password), "B.jsp" contains a form-submit to add the records to a database. "C.jsp" is the actual one which does the updating to the database.
    Q1, how can I re-use the login name and password for "B.jsp" and "C.jsp"?
    Q2, is there any security problem to do so?
    your useful reply will give me a great help.
    ths

    or try here:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=308840
    http://forum.java.sun.com/thread.jsp?forum=31&thread=295349

  • JSP AND BEAN PROBLEm   java.lang.nullpointerexception   help me please

    hello i have a problem, when i open login.jsp and enter the form i have nullpointerexception. i don't understand where i wrong... i use tomcat 5.5 ... sorry for my english i'm italian and i speak only italian :(
    login.jsp this is the code of the java server page
    <html>
    <%@ page language="java" import="java.sql.*" %>
    <jsp:useBean id="lavoro" scope="page" class="Ok.Dino"/>
    <%@ page session="false" %>
    <style type="text/css">
    <!--
    body {
         background-color: #003366;
    a:link {
         color: #CCCCCC;
    .style1 {
         color: #000000;
         font-weight: bold;
         font-size: x-large;
    .style4 {font-size: 18px}
    -->
    </style>
    <body>
    <%if(request.getMethod()=="GET"){
    %>
    <form action="login.jsp" method= "POST" name="frmlogin" id="frmlogin">
         <div align="center">
           <p class="style1">AUTENTICAZIONE</p>
           <p> </p>
           <table width="318" height="140" border="1">
            <tr>
              <td width="95" height="60" bordercolor="#000000" bgcolor="#0066CC"><p align="center"><strong>USER</strong></p>          </td>
              <td width="207" bgcolor="#0099CC"><p align="center">
                <input type="text" name="txtnome"></p>
              </td>
            </tr>
            <tr>
              <td height="72" bordercolor="#000000" bgcolor="#0066CC"><strong>PASSWORD</strong> </td>
              <td width="207" bgcolor="#0099CC"><div align="center">
                <input name="pwdtxt" type="password">
              </div></td>
            </tr>
          </table>
           <table width="318" border="1">
            <tr>
              <td width="318" height="87"> <div align="center">
                <input name="submit" type="submit" value="invia"  >
              </div>
              <p align="center"><strong><span class="style4">Se non sei registrato fallo <a href="file:///C|/Documents and Settings/access/Documenti/My Received Files/registrazione.jsp">adesso </a></span></strong></p></td>
            </tr>
          </table>
           <p> </p>
           <p> </p>
      </div>
    </form>
    <%}else {  %>
    <%lavoro.settxtnome(request.getParameter("txtnome"));%>
    <%!ResultSet rs=null;
         String x=null;
    %>
    <% lavoro.cn_db("dbutenti");%>
    <% rs=lavoro.run_query("SELECT user FROM utenti");%>
    <%}%>
    </body>
    </html>and this is the bean code
    package Ok;
    import java.sql.*;
    public class Dino
    private String txtnome,pwdtxt;
    private Connection cn=null;
    private Statement st=null;
    private ResultSet Rs=null;
    public String gettxtnome()
    return txtnome;
    public String getpwdtxt()
    return pwdtxt;
    public void settxtnome(String n)
    this.txtnome=n;
    public void setpwdtxt(String n)
    this.pwdtxt=n;
    public void cn_db(String db)
              if(cn==null){
              //1. Caricamento del driver
              try{
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              }catch(ClassNotFoundException cnfe){
                   System.out.println("impossibile caricare il driver");
                   System.exit(1);
              try{
                   //2. Connessione al DB
                   cn = DriverManager.getConnection("jdbc:odbc:"+db);
                   //3. creazione degli oggetti Statement e ResultSet
                   st =cn.createStatement();
              }catch(SQLException e){
                   System.out.println(e+"jjj");
    }else{
         System.out.print("errore database gi�� creato");
    public ResultSet run_query(String qr)
         try{
    Rs=st.executeQuery(qr);
         }catch(SQLException e)
         System.out.print(e+"ecco l'error");
         return Rs;
    }

    Do you understand when a NullPointerException will be thrown? This will be thrown if you want to access an uninstantiated Object.
    So look to the stacktrace and go to the line where the NPE is been thrown and doublecheck if the object reference is actually instantiated.
    Or add a null-check to the object reference:if (someObject != null) {
        someObject.doSomething();
    }or just instantiate it:if (someObject == null) {
        someObject = new SomeObject();
    someObject.doSomething();

  • DMM SuperUser URL :8080/dmsadmin/admin/login redirects and can't access

    For some reason I can no longer access the superuser admin for the DMM. When we connected the DMM to LDAP we had to start using 
    http://SERVERADDRESS:8080/dmsadmin/admin/login
    Where I go there it redirects to
    https://SERVERADDRESS.com:8443/dmsadmin/login/loginView.jsp?goto=http%3A%2F%2FSERVERADDRESS.com%3A8080%2Fdmsadmin%2Fj_spring_dms_security_check
    Any ideas?

    Do a search for the wdbsvr.app file and make sure there is a DAD entry for both the portal and login server and that they are correct.

  • Please help with jsp and database!!

    Hello,
    i first created a jsp page and printed out the parameters of a user's username when they logged in. example, "Welcome user" and it worked fine...
    i inserted a database into my site that validates the username and password, and ever since i did that in dreamweaver, when a user logs in sucessfully, it returns the jsp page like its supposed to, only that it says "Welcome null" instead of "Welcome John." pretty strange, huh!? can anyone please help? thanks!
    here is the important part of the code to Login.jsp, and LoginSuccess.jsp: <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" %>
    <%@ include file="Connections/Login.jsp" %>
    <%
    // *** Validate request to log in to this site.
    String MM_LoginAction = request.getRequestURI();
    if (request.getQueryString() != null && request.getQueryString().length() > 0) MM_LoginAction += "?" + request.getQueryString();
    String MM_valUsername=request.getParameter("Username");
    if (MM_valUsername != null) {
      String MM_fldUserAuthorization="";
      String MM_redirectLoginSuccess="LoginSuccess.jsp";
      String MM_redirectLoginFailed="LoginFailure.jsp";
      String MM_redirectLogin=MM_redirectLoginFailed;
      Driver MM_driverUser = (Driver)Class.forName(MM_Login_DRIVER).newInstance();
      Connection MM_connUser = DriverManager.getConnection(MM_Login_STRING,MM_Login_USERNAME,MM_Login_PASSWORD);
      String MM_pSQL = "SELECT UserName, Password";
      if (!MM_fldUserAuthorization.equals("")) MM_pSQL += "," + MM_fldUserAuthorization;
      MM_pSQL += " FROM MemberInformation WHERE UserName=\'" + MM_valUsername.replace('\'', ' ') + "\' AND Password=\'" + request.getParameter("Password").toString().replace('\'', ' ') + "\'";
      PreparedStatement MM_statementUser = MM_connUser.prepareStatement(MM_pSQL);
      ResultSet MM_rsUser = MM_statementUser.executeQuery();
      boolean MM_rsUser_isNotEmpty = MM_rsUser.next();
      if (MM_rsUser_isNotEmpty) {
        // username and password match - this is a valid user
        session.putValue("MM_Username", MM_valUsername);
        if (!MM_fldUserAuthorization.equals("")) {
          session.putValue("MM_UserAuthorization", MM_rsUser.getString(MM_fldUserAuthorization).trim());
        } else {
          session.putValue("MM_UserAuthorization", "");
        if ((request.getParameter("accessdenied") != null) && false) {
          MM_redirectLoginSuccess = request.getParameter("accessdenied");
        MM_redirectLogin=MM_redirectLoginSuccess;
      MM_rsUser.close();
      MM_connUser.close();
      response.sendRedirect(response.encodeRedirectURL(MM_redirectLogin));
      return;
    %>
          <form action="<%=MM_LoginAction%>" method="get" name="Login" id="Login">
            <table width="55%" border="0">
              <tr>
                <td width="41%">Username </td>
                <td width="59%"><input name="Username" type="text" id="Username" value="" size="25" maxlength="10"></td>
              </tr>
              <tr>
                <td>Password </td>
                <td><input name="Password" type="password" id="Password" value="" size="25" maxlength="10"></td>
              </tr>
              <tr>
                <td> </td>
                <td><input type="submit" name="Submit" value="Submit"></td>
              </tr>
            </table>
          </form>And LoginSuccess.jsp where i want it to print out the "Welcome username
             <%String Name=request.getParameter("Username");
         out.println ("Welcome ");
         out.println (Name); %>

    <%@ page contentType="text/html; charset=iso-8859-1"
    language="java" import="java.sql.*" %>
    <%@ include file="Connections/Login.jsp" %>
    <%
    // *** Validate request to log in to this site.
    String MM_LoginAction = request.getRequestURI();
    if (request.getQueryString() != null &&
    request.getQueryString().length() > 0) MM_LoginAction
    += "?" + request.getQueryString();
    String
    MM_valUsername=request.getParameter("Username");
    if (MM_valUsername != null) {
    String MM_fldUserAuthorization="";
    String MM_redirectLoginSuccess="LoginSuccess.jsp";
    String MM_redirectLoginFailed="LoginFailure.jsp";
    String MM_redirectLogin=MM_redirectLoginFailed;
    Driver MM_driverUser =
    =
    (Driver)Class.forName(MM_Login_DRIVER).newInstance();
    Connection MM_connUser =
    =
    DriverManager.getConnection(MM_Login_STRING,MM_Login_US
    RNAME,MM_Login_PASSWORD);
    String MM_pSQL = "SELECT UserName, Password";
    if (!MM_fldUserAuthorization.equals("")) MM_pSQL +=
    = "," + MM_fldUserAuthorization;
    MM_pSQL += " FROM MemberInformation WHERE
    E UserName=\'" + MM_valUsername.replace('\'', ' ') +
    "\' AND Password=\'" +
    request.getParameter("Password").toString().replace('\'
    , ' ') + "\'";
    PreparedStatement MM_statementUser =
    = MM_connUser.prepareStatement(MM_pSQL);
    ResultSet MM_rsUser =
    = MM_statementUser.executeQuery();
    boolean MM_rsUser_isNotEmpty = MM_rsUser.next();
    if (MM_rsUser_isNotEmpty) {
    // username and password match - this is a valid
    lid user
    session.putValue("MM_Username", MM_valUsername);
    if (!MM_fldUserAuthorization.equals("")) {
    session.putValue("MM_UserAuthorization",
    ion",
    MM_rsUser.getString(MM_fldUserAuthorization).trim());
    } else {
    session.putValue("MM_UserAuthorization", "");
    if ((request.getParameter("accessdenied") != null)
    ll) && false) {
    MM_redirectLoginSuccess =
    ess = request.getParameter("accessdenied");
    MM_redirectLogin=MM_redirectLoginSuccess;
    MM_rsUser.close();
    MM_connUser.close();
    response.sendRedirect(response.encodeRedirectURL(MM_re
    irectLogin));
    return;
    %>
    <form action="<%=MM_LoginAction%>" method="get"
    "get" name="Login" id="Login">
    <table width="55%" border="0">
    <tr>
    <td width="41%">Username </td>
    <td width="59%"><input name="Username"
    ="Username" type="text" id="Username" value=""
    size="25" maxlength="10"></td>
    </tr>
    <tr>
    <td>Password </td>
    <td><input name="Password" type="password"
    ="password" id="Password" value="" size="25"
    maxlength="10"></td>
    </tr>
    <tr>
    <td>�</td>
    <td><input type="submit" name="Submit"
    me="Submit" value="Submit"></td>
    </tr>
    </table>
    </form>
    And LoginSuccess.jsp where i want it to print out the
    "Welcome username
             <%String Name=request.getParameter("Username");
         out.println ("Welcome ");
         out.println (Name); %>When the page is rediredted u r not passing the user name in the query string,so it is not availble in the query string for LoginSuccess page
    Since u have added user in session user this
    <%String Name=(String)session.getValue("MM_Username") ;%>
    <%     out.println ("Welcome ");
    <%      out.println (Name); %>

  • Jsp-file="/WEB-INF/index.jsp" cannot load

              Hi,
              I am defining a servlet in the web.xml file using the following syntax.
              <servlet>
              <servlet-name>TestServlet</servlet-name>
              <jsp-file>/WEB-INF/index.jsp</jsp-file>
              </servlet>
              Then when I tried to access this servlet, I get a 404 not found error. The weblogic.log
              file complains with the following message:
              java.io.FileNotFoundException: no resource '/WEB-INF/index.jsp' in servlet context
              root '/home/dev/web/apps/MyApp'
              at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:293)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:922)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:886)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              My jsp file in located in /home/dev/web/apps/MyApp/WEB-INF/index.jsp, I know weblogic
              doesn't support jsp under WEB-INF, however, according to Sun's Servlet specification,
              anything under web-inf should be accessible to getResource and getResourceAsStream
              method, and it looks like that's what weblogic implementation is using (from the
              error message). So I am not sure whether this is weblogic issue or I am doing
              something wrong. By the way, the above config in web.xml is supported in Tomcat.
              

              What version of WebLogic will incorporate Servlet spec 2.4 and allow jsp under
              web-inf?
              Chris
              "Narayan Anand" <[email protected]> wrote:
              >Regarding S-12864 - It will not work as stated in the solution in any
              >of
              >the available releases of WLS.
              >Please ignore that. I already informed the concerned person to correct
              >the
              >solution.
              >
              >The story behind this is:
              >Our engineering team is already aware of the fact that the request
              >dispatcher calls (include/forward) for a jsp under the web-inf directory
              >works in other app server - Tomcat.
              >Our engineering team had a discussion with the servlet/jsp spec experts
              >group for clarifying the spec and the tomcat implementation.
              >So the servlet expert group has decided to explicitly state in the spec
              >that
              >RD.forward() and RD.include() should be allowed access to resources in
              >/WEB-INF and it will be included in servlet spec 2.4. For now, WLS works
              >as
              >per the current specification.
              >
              >So far the story is - WLS will implement this in our next major release
              >which will be compliance with servlet spec 2.4.
              >In all the currently available WLS releases, accessed to a jsp under
              >the
              >WEB-INF directory is prohibited.
              >
              >--
              >Best Regards,
              >Narayan Anand
              >Developer Relations Engineer
              >BEA Systems, Inc.
              >
              >
              >
              >
              >
              >
              >"Ming Fan" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Thanks for the explanation. So this means weblogic treats such mapped
              >servlet request
              >> as a direct request to the jsp under WEB-INF, instead of forwarding
              >it to
              >some
              >> JspCompiler servlet and let that compiler servlet use some resource
              >loader
              >to
              >> load the jsp and then compile. I believe that latter implementation
              >approach also
              >> conforms the Servlet spec (it's a different way of treating the request,
              >I
              >guess).
              >>
              >> Now here's another question. According to Web logic Customer Support
              >Solution
              >> ID S-12864 (WLS 6.x - Cannot access JSP under the WEB-INF directory),
              >the
              >servlet
              >> should be able to get a request dispatcher, and then forward the request
              >to the
              >> jsp under WEB-INF. I am still using WLS 5.1, so does the above solution
              >apply
              >> to 5.1 also? It doesn't seem to work with 5.1. So is this a 5.1 problem
              >and I
              >> should upgrade to 6.1?
              >>
              >> Thanks.
              >>
              >> "Narayan Anand" <[email protected]> wrote:
              >> >Hi Ming,
              >> >
              >> >It is legal to put files under WEB-INF directory. But as mentioned
              >in
              >> >the
              >> >spec, it will be available only to servlet code and not directly to
              >client
              >> >request.
              >> >Read the last statement of the same paragraph in section9.5.
              >> >"Since requests are matched to resource mappings case-sensitively,
              >client
              >> >requests for '/WEB-INF/foo', '/WEb-iNf/foo', for example, should not
              >> >result
              >> >in contents of the web application located under /WEB-INF being returned,
              >> >nor any form of directory listing thereof.".
              >> >
              >> >So in your case, when you access the servlet which gets mapped to
              >> >/WEB-INF/your-jspfile, under no condition it should result in display
              >> >of jsp
              >> >contents.
              >> >It is working as per the specification.
              >> >
              >> >I hope this helps.
              >> >
              >> >Regards,
              >> >Narayan Anand
              >> >Developer Relations Engineer
              >> >BEA WebLogic Support
              >> >
              >> >
              >> >
              >> >"Ming Fan" <[email protected]> wrote in message
              >> >news:[email protected]...
              >> >>
              >> >> Actaully there are other ways to solve my problem. But what I am
              >> >interested to
              >> >> know is under the Servlet specification 2.3, is it legal to put
              >jsp
              >> >under
              >> >WEB-INF,
              >> >> define it in <jsp-file> xml tag, and should the JSP compiler be
              >able
              >> >to
              >> >see this
              >> >> as a resource. Apparently, Tomcat allows this behavior, so does
              >this
              >> >mean
              >> >Tomcat
              >> >> conforms better to the Servlet spec, or Tomcat is wrong but Weblogic
              >> >conforms
              >> >> better? Can anyone let me know what's the correct interpretation
              >of
              >> >section 9.5
              >> >> in servlet spec 2.3?
              >> >>
              >> >>
              >> >> "Jerrie Pineda" <[email protected]> wrote:
              >> >> >Try moving it to a different dir. You normally don't place jsp
              >file
              >> >> >in the
              >> >> >WEB-INF dir.
              >> >> >
              >> >> >
              >> >> >"Ming Fan" <[email protected]> wrote in message
              >> >> >news:[email protected]...
              >> >> >>
              >> >> >> Hi,
              >> >> >>
              >> >> >> I am defining a servlet in the web.xml file using the following
              >> >syntax.
              >> >> >> <servlet>
              >> >> >> <servlet-name>TestServlet</servlet-name>
              >> >> >> <jsp-file>/WEB-INF/index.jsp</jsp-file>
              >> >> >> </servlet>
              >> >> >>
              >> >> >> Then when I tried to access this servlet, I get a 404 not found
              >> >error.
              >> >> >The
              >> >> >weblogic.log
              >> >> >> file complains with the following message:
              >> >> >> java.io.FileNotFoundException: no resource '/WEB-INF/index.jsp'
              >> >in
              >> >> >servlet
              >> >> >context
              >> >> >> root '/home/dev/web/apps/MyApp'
              >> >> >> at
              >weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:293)
              >> >> >> at
              >> >weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:
              >2
              >> >0
              >> >> >0)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.ja
              >v
              >> >a
              >> >> >:115)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextI
              >m
              >> >p
              >> >> >l.java:922)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextI
              >m
              >> >p
              >> >> >l.java:886)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletConte
              >x
              >> >t
              >> >> >Manager.java:269)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380
              >)
              >> >> >> at
              >> >> >weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
              >> >> >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              >> >> >>
              >> >> >> My jsp file in located in
              >/home/dev/web/apps/MyApp/WEB-INF/index.jsp,
              >> >> >I
              >> >> >know weblogic
              >> >> >> doesn't support jsp under WEB-INF, however, according to Sun's
              >Servlet
              >> >> >specification,
              >> >> >> anything under web-inf should be accessible to getResource and
              >> >> >getResourceAsStream
              >> >> >> method, and it looks like that's what weblogic implementation
              >is
              >> >using
              >> >> >(from the
              >> >> >> error message). So I am not sure whether this is weblogic issue
              >> >or
              >> >> >I am
              >> >> >doing
              >> >> >> something wrong. By the way, the above config in web.xml is
              >supported
              >> >> >in
              >> >> >Tomcat.
              >> >> >
              >> >> >
              >> >>
              >> >
              >> >
              >>
              >
              >
              

  • How to bring Login.jsp under a html frame ?

    hi all.
    I have customized the Login.jsp and actually have lot of static content to be displayed in our proposed entry page.
    I decided to use Html frames - something like the one below.
    When i point on the frame to the Login.jsp ( i referred it as 'amserver/UI/Login') --> it loads all frames then redirects the page to the /amserevr/UI/Login -> the Login.jsp now occupies the entire screen and i c none of the html frames..
    any idea how to bring in the portal Login.jsp under a html frame ?
    Thanks
    Vee
    <html>
    <frameset noresize="noresize" frameborder=0 rows="25%,70%,5%">
    <frame frameborder=0 noresize="noresize" src="/amserver/UI/Login" name="banner_frame" scrolling=no>
    <frameset frameborder=0 noresize="noresize" cols="30%,70%">
    <frame frameborder=0 src="./images/menus.gif" name="menu_frame" scrolling=no>
    <frame frameborder=0 src="./images/content.gif" name="content_frame" scrolling=no>
    </frameset>
    <frame frameborder=0 src="./images/copyright.gif" name="copyright" scrolling=no>
    </frameset>
    </html>

    is it possible to write jsp code or javascript code inside this Login.jsp ?
    I got a bunch of content - menu driven to displayed additional to the identity server login module.
    veera

  • Unable to login to the web console cisco Prime assurance 9.0 password not working :(

    Hi all,
    I was able to install the Cisco Prime 9.0 assurance
    I am entering the correct username and password still I am not able to login to Web admin page
    How do i reset the password and login to the web admin console??
    Plz help... urgent...
    Rgds,
    Rebecca.... 

    Thanks Rob so much
    yes i booted the NCS from the DVD and installed the applications
    now i have two NCS appliances one is running PI 1.2 and other LMS 4.2

  • Connecting to Servlet from a Login JSP page

    Hi Everyone can anyone tell how to invoke a Servlet say DBHandler servlet from a Login JSP page
    I am using JRun3.0
    If i do this i am getting an error Error 405 Resource not allowed
    The directory structure is as follows :::-----
    emtech\jsp\Login.jsp
    emtech\web-inf\classes\DBHandler.java
    in my Login.jsp page i am giving
    <form method="post" action ="DBHandler">
    </form>
    Help will be highly appreciated
    Thanking in advance
    Mumtaz
    India

    Hi
    Even after modifying i am getting the same problem
    if i use jsp:forward tag then it works fine ie transfers control fully to the servlet but if i set the form action
    like /servlet/LoginServlet or LoginServlet i get this in my url ---http://localhost:8100/emtech2/jsp/emtech2/servlet/LoginServlet
    i just am thinking of using JRun
    Plz help
    Thanking You

  • Changing the directory Structure of Jsp and web.xml files

    Hi,
    I am using the JDeveloper 11g preview. Can any one tell me how to change the Jsp and web.xml files ( not in WEB-INF directory of the application) to another directory.
    Thanks in Advance
    Gopal

    Hi Frank,
    Is it possible for me to change the folder structure which JDeveloper is providing for web project?
    By default JDeveloper is giving the following folder structure.
    In the project's root folder there is a public_html and src folder along with .jpr file.
    In public_html folder thre is an WEB-INF folder and a jsp file
    In WEB-INF folder there is an classes folder along with web.xml file.
    I need to have the following folder structure :
    The WEB-INF folder should be in root folder of project not in public_html folder
    src folder must be in WEB-INF folder.
    Thanks in Advance
    Anil Golla

Maybe you are looking for

  • Lightroom 4.1 (3, 4 or any version) causes computer to blue screen and crash

    Recently bought the new Lightroom 4.1 in an attempt to fix this issue, which had been occuring off and on for some time.  I have major difficulties with importing and/or rendering previews or editing Canon 5D Mark II and Canon 5D Mark III images usin

  • Slow In Readind The Hard Disk

    My computer is running on Linux and my WD external hard disk is Element 1TB about 90% full. It store mostly movies. But recently my hard disk find it very slow to access. I have deleted some files but it is still the same. When I empty my trash. It's

  • Park Post option in F-48 & F-53

    Hi My client has requirement in Payments (F-53) & Downpayments (F-48) that entry must be entered by someone else & it must be posted by someone else after verification. There is park & post option in FB60, FB70, etc. But there is not such parking & p

  • Adobe Creative Suite 6 Master Collection - A valid installer could not be found

    Hi, For our organisation i want te create a unattended installation for Adobe Creative Suite 6 Master Collection. I received 3 .iso files from our distributor (SurfMarket.nl) that i've extracted. When using Adobe Application Manager Enterprise Editio

  • What's a easy way to rename my network.

    I am using Airport Express and its great but i don't like my network name, others around can see my name i didn't think of that since i just got it today. Anyone know of a easy way to rename my network or wifi. Thanks for any help in advance.