**help on login servlet

the following are my source code. but i cant show the msg whether the person has login successful or not. i am using j2ee to run my eg.
LoginServlet.java
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class LoginServlet extends HttpServlet {
public void init(ServletConfig config) throws ServletException {
super.init(config);
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>" +
"<head><title>Login</title></head>");
out.println("<body><p align=\"center\">"+
"<font face=\"Arial Narrow\">"+
"<h1><b> Login</b></h1></font></p><hr>"+
"<form method=\"POST\">"+
"<font face=\"Arial Narrow\" size=\"2\">Enter ur username and password:</font>"+
"<p><font face=\"Arial Narrow\" size=\"2\">Username: "+
"<input type=\"text\" name=\"user\" size=\"25\"><br><br>"+
"Password: <input type=\"text\" name=\"pass\" size=\"25\"></font></p>"+
"<p align=\"left\"><input type=\"submit\" value=\"Login\"></p>"+
"</form>");
String username= request.getParameter("username");
String password= request.getParameter("password");
String un="user";
String pw="1234";
boolean loginCorrect = false;
if((username==un)&&(password==pw))
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher("/result");
if (dispatcher != null)
dispatcher.include(request, response);
out.println("</body>");
out.println("</html>");
out.close();
ResultServlet.java
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
* This is a simple example of an HTTP Servlet. It responds to the GET
* method of the HTTP protocol.
public class ResultServlet extends HttpServlet {
public void init(ServletConfig config) throws ServletException {
super.init(config);
public void doGet (HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
PrintWriter out = response.getWriter();
// then write the data of the response
String username= request.getParameter("username");
String password= request.getParameter("password");
String un="user";
String pw="1234";
boolean loginCorrect = false;
if((username==un)&&(password==pw))
loginCorrect=true;
out.println("Login Successfully");
if(!loginCorrect)
out.println("Invalid password or username");
thanks

I would add
response.setContentType("text/html");
before
PrintWriter out = response.getWriter();
...also remember that you need it to be valid html... ie. you need all the tags you would use when writing html... (println() them all to your PrintWriter).
I am a little confused as to your problem... is it that ResultServlet isn't being invoked, or an error is happening while ResultServlet is executing ?

Similar Messages

  • Getting error 404 when iam running a simple login servlet in tomcat

    hi
    this is my Login.java
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class Login extends HttpServlet
         public void doPost(HttpServletRequest rq, HttpServletResponse rs)
              String username =rq.getParameter("username");
              String password =rq.getParameter("password");
    try{
              rs.setContentType("text/html");
              PrintWriter out=rs.getWriter();
              out.println("<html><body>");
              out.println("thank u, " + username + "you r logged sucessfully");
              out.println("</body></html>");
              out.close();
              }catch(Exception e){
                   e.printStackTrace();
    i have saved in the form ofC:\Program Files\apache-tomcat-4.1\webapps\sravan\WEB-INF\classes\Login.class
    where sravan is my folder
    step 2: Login.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>login page</title></head>
    <body>
    <h1> WELCOME TO THE SERVLET HOME PAGE</h1>
    ENTER UR USERNAME AND PASSWORD
    <form action="/sravan/Login" method="Post">
         username<input type="text" name="username" >
         password<input type="password" name="password" >
         <input type="submit" value="submit"></form>
         </body>
    </html>
    i have saved in the form C:\Program Files\apache-tomcat-4.1\webapps\sravan\Login.html
    step3:
    my web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>beginning j2ee</display-name>
    <servlet>
    <servlet-name>Login</servlet-name>
    <servlet-class>Login</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Login</servlet-name>
    <url-pattern>Login</url-pattern>
    </servlet-mapping>
    </web-app>
    i have saved in C:\Program Files\apache-tomcat-4.1\webapps\sravan\WEB-INF\web.xml
    step4:
    here is my server.xml
    <Context path="/sravan" docBase="sravan" debug="0" reloadable="true" privileged="true"/>
    saved in C:\Program Files\apache-tomcat-4.1\webapps\sravan\WEB-INF\server.xml
    everything is fine....program is compiled ...but when iam running the servlet in tomcat iam getting error 404 Login.html not found....
    so plz kindly help me this my first servlet .....

    There seems not to be any '.html' in your url-pattern
    <url-pattern>Login</url-pattern>- so i presume you should use
    http://yourhost/Logininstead.

  • Levels in login servlet

    I am about to extend my login servlet.
    First I want to give each user different levels.
    Example I have 4 options
    - Watch topics
    - Modify topics
    - Delete topics
    - Create new user
    User 1 is allowed to do all 4 options.
    User 2 is only allowed to use 1st option
    User 3 is allowed to use top 3 options
    User 4 is allowed to use top 2 options
    Which way is the best way to build such 'check'?
    Second, I need to have some check added to check if the origin of the login form, is from the same server .
    thanks
    Andreas

    OK, create your role keys like this:
    int watchRole = 1; // binary 0001
    int modifyRole = 2; // binary 0010
    int deleteRole = 4; // binary 0100
    int createRole = 8; // binary 1000Your user's all have a 'mask' as well, which would be stored in your database alongside their username and password. If the user joe needs 'watch' and 'modify' permissions, his mask would be 1+2=3:
    int userKey = 3; // binary 0011When an action requiring 'modify' permissions is attempted, the following operation will check authentication:
    if (userKey & modifyRole == modifyRole) {
    // user is authenticated
    } else {
    // user is NOT authenticated
    }So Joe would be successfully authenticated.
    You can use different binary AND/OR logic to perform different operations or checks:
    (roleKey | roleKey) // combines permissions
    (userKey & roleKey) // checks permissions
    (userKey | roleKey) // adds permissions
    (userKey & !roleKey) // deletes permissionsEg to add 'delete' permissions to Joe you do this:
    userKey = userKey | deleteRole;and the resultant userKey now has delete permissions.
    I'd recommend googling for binary logic if you're still unsure about how this all works.
    Hope that helps.
    --Jon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Help,JSP and SERVLETS!

    hello:
    i've downloaded ECLIPSE 3.2,TOMCAT 5.5 .
    i tried to build simples examples o servlets but i failed could you please tell me how to proceed?i'm new at this plus i've got a project to do with all this so plz can you give some links to go,i tried but no links was clear.
    i've got to give to my professor an examples executed (servlets,jsp)
    thank you

    HISSO wrote:
    i wil give up on talking about stupid gossip
    you must act professional and i you can't help it's ok
    so plz i juste want help
    i'm so busy finishing my studies
    when it comes to talk about development with tomcat and eclipse together i'm new so i need some advices,so plz let's be serious!
    i'm working hard to finish my project!Try to communicate less like a monkey with electrodes attached to it's genitals. This means stop using words like "plz" and write "please" instead.
    If you want specific help with a specific problem then you should ask a specific question. "help, JSP and SERVLETS" is not a specific question. And you should also note that if your specific question is about Tomcat specifically or Eclipse specifically then you are in the wrong place to begin with.
    So do you want to try again?

  • Why i get servlet exception/login servlet not found exception  with .ear ?

    I am able to deploy my war and after that generating the ear from that. both works fine in local system.
    But when i run (Jboss as service[Java Service Wrapper]) it takes war without any problem.But with ear file i am getting servlet not found exception.I can't understand where this problem is coming from.
    Even if i take my JSPWIki ear which is running well in production server, this also gives same error.
    One more thing, the files, what i am running well in local system i.e. war and ear working fine. (can't test in production server so testing in same kind of testing server) there also getting login servlet not found exception. Even in same location other files which are deployed are working fine.out of 4 at least one is working fine.
    I don't undersatnd where this whole problem is .
    Please guiide me where sholud i concentrate to solve this problem.
    thnaks
    Vijendra

    I took the source code including the dll files already added to the project from here:
    spazzarama/Direct3DHook
    The solution include two projects the one name Capture is class library type and the dll that make the exception is in this project.
    I tried now to use the program Dependency Walker on this dll file and it found error/s:
    This is the log:
    Error: At least one required implicit or forwarded dependency was not found.
    Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
    Error: Modules with different CPU types were found.
    Warning: At least one delay-load dependency module was not found.
    Screenshot:
    It happen only when using/detecting Direct3D 11 . So far only in Direct3D 11, When i use it with a game that run Direct3D 9 it's working fine.
    The question is how can i solve this dll problem ? Any site/place to download this dll from ?

  • RequestDispatcher in login servlet

    Hi,
    My index.jsp includes a number of pages. One of them is a login bar on the top. A login servlet processes the login action, but I'm not quite sure what to do when login fails. On a successful login, I do a sendRedirect("index.jsp") and it works fine. But when login is unsuccessful, I need to pass an error message to the login box. I put an errormessage attribute in the request, but it doesn't show if I redirect to index.jsp. So I tred to forward like this:
    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/index.jsp");
         }else{
              request.setAttribute("errormsg", "Wrong username or password");
              dispatcher.forward(request,response);
            }Now I get the error message on the page, but the is now /myapp/login instead of /myapp/index.jsp
    How do I get back to the index.jsp without losing the error message attribute?
    Thanks
    Andre

    Forward is a ServerSide Include So that The Browser Don't know about it so the url in browser not changed.
    Use sendRedirect instead of forward
    response.sendRedirect();

  • Help with a simple login servlet

    I appreciate any help and assistance you all can give. I'm in an Intro to Java class on Georgia State and have an issue with this servlet I'm building. We're developing a login system where we have an http form pass a studentid and pin number to a servlet, then the servlet will match those inputs against the result set from an access database query using sql. I keep getting an error that will be posted below and I can't see any reason why I'd be getting it. Again any help would be appreciated. Here's the info:
    import java.io.*;
    import java.util.*;
    import java.sql.*; // for JDBC
    import javax.servlet.*; // for Servlet
    import javax.servlet.http.*; // for HttpServlet
    public class StudentLogin extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException{
              //get parameters
                        String aStudentId = (String) request.getParameter("studentid");
              String aPin = (String) request.getParameter("pin");
              //define the data source
                        String url = "jdbc:odbc:CIS3270Project";
                        Connection con = null;
                        Statement stmt;
                        String query;
              ResultSet rs = null;
                        //exception handling
                        try {
                        //load the driver -throws ClassNotFoundException
                        Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
                        catch (ClassNotFoundException cnfe) {
                        System.err.println (cnfe);
         try {
                        con = DriverManager.getConnection (url, "my-user", "my-passwd");
                        // create sql statement
                        stmt = con.createStatement ();
                        query = "SELECT * FROM STUDENT WHERE StudentID='" + aStudentId + "'";
                        // run the query
                        rs = stmt.executeQuery (query);
                        //get data from result set
                             rs.next();
                             String studentId = rs.getString("StudentID");
                             String pin = rs.getString("PIN");
                             System.out.println(studentId);
                             System.out.println(pin);
                   catch (SQLException ex) {
                        ex.printStackTrace();
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
              //compare form data to result set
    if(aPin.equals(pin)){
                   System.out.println("Login Successful");
              else{
                   System.out.println("Login Failed");
    The error is as follows:
    StudentLogin.java:58: cannot resolve symbol
    symbol : variable pin
    location: class StudentLogin
    if(aPin.equals(pin)){
    ^
    1 error
    I've declared pin and there should be no issue with it using it as an argument in this string comparison. Thanks for any light you can shed on this.
    -Matt

    Alright, I've broken up the code and made it more modular. Here's my code for my Authenticator class followed by the code in the servlet.
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class Authenticator{
         //define the data source
         Connection con = null;
         Statement stmt;
         String query;
    ResultSet rs = null;
         public void loadDb(){
              try {
                   //load the driver -throws ClassNotFoundException
                   Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
              catch (ClassNotFoundException cnfe) {
                   System.err.println (cnfe);
              try {
                   con = DriverManager.getConnection ("jdbc:odbc:CIS3270Project", "my-user", "my-passwd");
              catch (SQLException ex) {
                   ex.printStackTrace();
         public void queryDb(String aStudentId){
              try {
                   // create sql statement
                   stmt = con.createStatement ();
                   query = "SELECT * FROM STUDENT WHERE StudentID='" + aStudentId + "'";
                   // run the query
                   rs = stmt.executeQuery (query);
              catch (SQLException xe) {
                   xe.printStackTrace();
              try {
                   //get data from result set
                   rs.next();
                   String studentId = rs.getString("StudentId");
                   String pin = rs.getString("PIN");
              catch (SQLException x) {
                   x.printStackTrace();
         public void isValid(String aPin){
              if(pin.equals(aPin)){
                   System.out.println("Login Successful");
              else{
                   System.out.println("Login Failed");
    Here's the servlet:
    import java.io.*;
    import java.util.*;
    import java.sql.*; // for JDBC
    import javax.servlet.*; // for Servlet
    import javax.servlet.http.*; // for HttpServlet
    public class StudentLogin extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException{
    //get parameters
              String aStudentId = (String) request.getParameter("studentid");
    String aPin = (String) request.getParameter("pin");
         Authenticator a = new Authenticator();
         a.loadDb();
         a.queryDb(aStudentId);
         a.isValid(aPin);
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    //bunch of HTML output shit goes here
    I keep getting an error of cannot resolve symbol in the isValid method. It can't resolve the variable 'pin' from the database query. Does try limit the scope of that variable to only inside that try statement? Thanks for any help you guys can give.

  • Help with Login Form (JSP DB Java Beans Session Tracking)

    Hi, I need some help with my login form.
    The design of my authetication system is as follows.
    1. Login.jsp sends login details to validation.jsp.
    2. Validation.jsp queries a DB against the parameters received.
    3. If the query result is good, I retrieve some information (login id, name, etc.) from the DB and store it into a Java Bean.
    4. The bean itself is referenced with the current session.
    5. Once all that's done, validation.jsp forwards to main.jsp.
    6. As a means to maintain state, I prefer to use url encoding instead of cookies for obvious reasons.I need some help from step 3 onwards please! Some code snippets will do as well!
    If you think this approach is not a good practice, pls let me know and advice on better practices!
    Thanks a lot!

    Alright,here is an example for you.
    Assume a case where you don't want to give access to any JSP View/HTML Page/Servlet/Backing Bean unless user logging system and let assume you are creating a View Object with the name.
    checkout an example (Assuming the filter is being applied to a pattern * which means when a resource is been accessed by webapplication using APP_URL the filter would be called)
    public doFilter(ServletRequest req,ServletResponse res,FilterChain chain){
         if(req instanceof HttpServletRequest){
                HttpServletRequest request = (HttpServletRequest) req;
                HttpSession session = request.getSession();
                String username = request.getParameter("username");
                String password = request.getParameter("password");
                String method = request.getMethod();
                String auth_type  = request.getAuthType();
                if(session.getAttribute("useInfoBean") != null)
                    request.getRequestDispatcher("/dashBoard").forward(req,res);
                else{
                        if(username != null && password != null && method.equaIsgnoreCase("POST") && (auth_type.equalsIgnoreCase("FORM_AUTH") ||  auth_type.equalsIgnoreCase("CLIENT_CERT_AUTH")) )
                             chain.doFilter(req,res);
                        else 
                          request.getRequestDispatcher("/Login.jsp").forward(req,res);
    }If carefully look at the code the autherization is given only if either user is already logged in or making an attempt to login in secured way.
    to know more insights about where these can used and how these can be used and how ?? the below links might help you.
    http://javaboutique.internet.com/tutorials/Servlet_Filters/
    http://e-docs.bea.com/wls/docs92/dvspisec/servlet.html
    http://livedocs.adobe.com/jrun/4/Programmers_Guide/filters3.htm
    http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html
    http://www.servlets.com/soapbox/filters.html
    http://www.onjava.com/pub/a/onjava/2001/05/10/servlet_filters.html
    and coming back to DAO Pattern hope the below link might help you.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html
    http://java.sun.com/blueprints/patterns/DAO.html
    http://www.javapractices.com/Topic66.cjp
    http://www.ibm.com/developerworks/java/library/j-dao/
    http://www.javaworld.com/javaworld/jw-03-2002/jw-0301-dao.html
    On the whole(:D) it is always a good practice to get back to Core Java/J2EE Patterns.and know answers to the question Why are they used & How do i implement them and where do i use it ??
    http://www.fluffycat.com/java-design-patterns/
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html
    http://www.cmcrossroads.com/bradapp/javapats.html
    Hope that might help :)
    REGARDS,
    RaHuL

  • Help needed in servlet sessions

    hi,
    I m having following servlet with the logon and logout request..
    and my problem is that I don't want 2session with same clientID
    means a client want to log in ( who is currently logged in with say ClientID=5)
    with same ClientID (=5) then he won't be able to do that.. and i m invalidating the session
    when client hits logout button ( i don't want to use session time out) but what if he just
    shut down his browser without logout. In that case i want to invalidate that session
    immediately (as it is necessary for first requirement) i.e. if the session resides in memory
    than client won't be able to log in again untill that session automatically invalidated...
    so help me!!!!
    thanks
    bhups
    some part of my code in which i m getting and invalidating session is given below.
    class myServlet extends HttpServlet{
    void doGet(req,res)
    Client _client=null;;
    HttpSession _session=req.getSession(false);
    if(_session!=null)
    client=(Client)session.getAttribute("_client");
    if(requestID.equals("Login"))
    String ClientID=req.getParameter("ClientID");
    String Password=req.getParameter("Password");
    String AuthenticationStatus=Authentication(ClientID,Password);
    if(AuthenticationStatus.equals("Authenticated"))
    _session=req.getSession(true);
    session.setAttribute("client",new Client(Integer.parseInt(ClientID),Password));
    res.sendRedirect("./inbox.html");
    else
    throw someException();
    if(requestID.equals("Logout"))
    if(_client!=null)
    _session.invalidate();
    res.sendRedirect("./login.html");
    class Client
    private int ClientID;
    private String Password;
    public Client(int cid,String password)
    ClientID=cid;
    Password=password;
    public int getClientID()
    return this.ClientID;
    }

    Hey this can be done using javascript
    U have to capture the window close event of the browser and for that event write a javascript function
    which calls the logout.jsp page or any other necessary servlets to do the logout process.
    a dummy example is given here
    someJsp.jsp
    <html>
    <head>
    <script>
                 function closeSession()
                                 window.navigate("logoff.jsp");
    </script>
    </head>
    <body onUnload="closeSession()">
    </body>
    </html>

  • Help needed on Servlets and JSTL

    Hi
    I am using tomcat 5.5 and JDK 1.5. What are the softwares I have to download for compiling servlets and creating JSTL ?. Help needed.
    Thanks
    IndyaRaja

    I tried compling servlet, but it is raising error
    that coul not find package javax.servletWhat I did not mention... you need to add those JARs in the Classpath explicitly. You will find them in %TOMCAT_HOME%\common\lib. You atleast need to add servlet-api.jar to your Classpath. :)

  • Help : Call Login Module directly when iView is launched - without submit

    Hi there,
    we have developed a login module on for our NW2004S SP13 Portal, that checks the IP address of the client to be in a valid range. If so, the standard SAP login screen must be bypassed. If not, the standard login screen needs to be shown (we use the standard sap umLogonPage, we only made a copy z.com.portal.runtime.logon.par) and added to the portalapp.xml an entry which is a copy of the 'certlogon' entry..
    -> What we like to achieve is that the logonstack is called directly when the application is launched.
    a) Code below functions, but only one problem : when the IP Address is invalid (login module returns false), a blank page is shown instead of the default userid / pw page.
        In case of valid IP OK, invalid IP (login module returns false) blank page :o(
    b) As an alternatice, in my opinion, it would be best to use the standard SAP class in the portalapp.xml  (com.sap.sapportals.portal.ume.component.logon.SAPMLogonComponent) & have some sort of servlet in front
    The behaviour of which page to return in case of failed logon is contained in com.sap.portal.runtime.logon_api.jar, class com.sap.sapportals.portal.ume.component.logon.SAPMLogonComponent -> class SAPMLogonLogic).
    How can this be done? I've already cracked my head over it, but can't get this to work -
    My coding for a) :
    package z.x.sapportals.portal.ume.component.logon;
    import com.sap.security.api.logon.ILogonFrontend;
    import com.sapportals.portal.prt.component.AbstractPortalComponent;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentResponse;
    import com.sapportals.portal.prt.session.IUserContext;
    public class xSAPMLogonComponent extends AbstractPortalComponent     implements ILogonFrontend
         protected void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
              response.write("\n<!-- component context:" + request.getComponentContext().getComponentName() + "-->\n");
              response.write("<!-- class: " + getClass().getName() + "-->\n");
              String firstName ="";
              String lastName = "";
              String logonUid = "";
              String password = "";
              String authscheme = "";
              IUserContext userContext = request.getUser();
              if (userContext != null)
                   firstName = userContext.getFirstName();
                   lastName = userContext.getLastName();
                   logonUid = userContext.getLogonUid();
                   password = "dummy";
                   authscheme = (String)request.getValue("com.sap.security.logon.authscheme.required");
                   response.write("Welcome :");
                   response.write("logonUid = " + logonUid + "<br><br>");
                   response.write("j_password = " + password + "<br><br>");
                   response.write("<form id=\"redirform\" method=\"post\" >");
                   response.write("<input type=\"hidden\" name=\"login_submit\" value=\"on\">");
                   response.write("<input type=\"hidden\" name=\"j_user\" value=\"" + logonUid + "\">");
                   response.write("<input type=\"hidden\" name=\"j_password\" value=\"" + password + "\">");
                   response.write("<input type=\"hidden\" name=\"j_authscheme\" value=\"" + authscheme + "\">");
                   response.write("<input type=\"submit\" value=\"send\">");
                   response.write("</form>");
    //                      Commented out javascript auto submit to press submit manually for testing
         /* (non-Javadoc)
    @see com.sap.security.api.logon.ILogonFrontend#getTarget()
         public Object getTarget()
              // TODO Auto-generated method stub
              return this;
         /* (non-Javadoc)
    @see com.sap.security.api.logon.ILogonFrontend#getType()
         public int getType() {
              // TODO Auto-generated method stub
              return 2;
    Portalapp.xml :
        <component name="iplogon">
          <component-config>
            <property name="ClassName" value="z.x.sapportals.portal.ume.component.logon.xSAPMLogonComponent"/>
            <property name="SafetyLevel" value="no_safety"/>
            <property name="LocalModeAllowed" value="true"/>
          </component-config>
          <component-profile>
            <property name="AuthScheme" value="anonymous"/>
            <property name="com.sap.portal.pcm.Category" value="platform">
              <property name="inheritance" value="final"/>
            </property>
            <property name="SupportedUserAgents" value="(MSIE, >=5.0, *) (Netscape, *, ) (Mozilla,,*)">
              <property name="inheritance" value="final"/>
            </property>
          </component-profile>
        </component>
    authschemes.xml
            <authscheme name="iplogon">
                <authentication-template>
                    radiusExtended
                </authentication-template>
                <priority>22</priority>
                <frontendtype>2</frontendtype>
                <frontendtarget>z.x.portal.runtime.logon.iplogon</frontendtarget>
            </authscheme>

    Hi,
    I'm not sure if you have already solved this issue, I was looking up another issue and came across this topic, maybe I can close this topic for you.....
    Here is what you could do...
    1) Create a custom login module stack with your login module
    2) Create a authentication scheme that refers this stack
      For example, you have defined a login module stack called certlogon in the Security Provider service in the Visual Administrator. You   want to create an authentication scheme that uses this login module stack. To do this, you add the following excerpt to the authschemes.xmlfile.
    <authscheme name="myauthscheme">
          <!-- multiple login modules can be defined -->
          <authentication-template>
            certlogon
          </authentication-template>
          <priority>20</priority>
          <!-- the frontendtype TARGET_FORWARD = 0 -->
          <!-- TARGET_REDIRECT = 1, TARGET_JAVAIVIEW = 2 -->
          <frontendtype>2</frontendtype>
          <!-- target object -->
          <frontendtarget>
            com.mycompany.certlogonapp
          </frontendtarget>
      </authscheme>
    In this schema refer your custom login application.
    thanks,
    Sudhir

  • Help with login, problems

    I restarted my computer, and now it goes to a black screen that says freebsd and asks me to enter my login and password, which I enter. It then goes to a terminal like command. I just want it to go back to normal. Any help? Thanks.

    Try typing "reboot" (without the quotes) at the terminal prompt and then press the Return key.

  • SOme more help on JSP-Servlets-Beans plz...!!

    Thanx a lot for your help !
    But I could not understand some things ...
    Suppose, I create 5 bean instances in my servlet, & "set" them with data from 5 tuples.
    Now, I need to pass these 5 bean objects to a JSP .
    HOW exactly can I pass them via a List object thru request attribute ?
    And, after doing that, HOW will I be able to access the individual Bean objects in the JSP ?
    Plz., see if you can send me some Code Snippets that illustrate the same.
    Once again, Thanks a lot for bearing with me !!
    Awaiting your response...
    Truly yours,
    Raghu

    Servlet:
    request.setAttribute ("someUniqueName", yourBeanList);
    JSP:
    Either <jsp:useBean> or insert a scriplet like <% List beanList = (List) request.getAttribute("someUniqueName"); %>

  • Need urgent help on Applet-Servlet communication

    Hi,
    I have a applet having two button A and B. A passes querystring "Select name from test where letter = A" when button A is pressed while B passes querystring "Select name from test where letter = B" when button B is pressed. The applet passes the string to a servlet which in turn queries a database to get the output name back to the applet. Both compiles fine but while running I am getting the following error:
    java.io.IOException:
    Any help is appreciated in advance. Thanks. Regards
    THE APPLET CODE:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    public class ReinApplet1 extends Applet implements ActionListener
    TextField text;
    Button button1;
    Button button2;
    TextArea taResults;
    String qryString1;
    public void init()
    button1 = new Button("A");
    button1.addActionListener(this);
    add(button1);
    button2 = new Button("B");
    button2.addActionListener(this);
    add(button2);
    taResults = new TextArea(2,30);
    add(taResults);
    // text = new TextField(20);
    // add(text);
    public void actionPerformed(ActionEvent e)
    Object obj = e.getSource();
    if(obj == button1)
    String qryString = "select name from test where letter = A";
    executeQuery (qryString);
    if(obj == button2)
    String qryString = "select name from test where letter = B";
    executeQuery (qryString);
    public void executeQuery (String query)
    String qryString1 = query;
    try
    URL url=new URL("http://localhost:8080/examples/servlet/ReinServlet1");
    String qry=URLEncoder.encode("qry") + "=" +
    URLEncoder.encode(qryString1);
    URLConnection uc=url.openConnection();
    uc.setDoOutput(true);
    uc.setDoInput(true);
    uc.setUseCaches(false);
    uc.setRequestProperty("Content-type",
    "application/x-www-form-urlencoded");
    DataOutputStream dos=new DataOutputStream(uc.getOutputStream());
    dos.writeBytes(qry);
    dos.flush();
    dos.close();
    InputStreamReader in=new InputStreamReader(uc.getInputStream());
    int chr=in.read();
    while(chr != -1)
    taResults.append(String.valueOf((char) chr));
    chr = in.read();
    in.close();
    // br.close();
    catch(MalformedURLException e)
    taResults.setText(e.toString());
    catch(IOException e)
    taResults.setText(e.toString());
    THE SERVLET CODE:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    public class ReinServlet1 extends HttpServlet
    Connection dbCon;
    public void init() throws ServletException
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    dbCon=DriverManager.getConnection("jdbc:odbc:Sales");
    catch(Exception e)
    System.out.println("Database Connection failed");
    System.out.println(e.toString());
    return;
    public void handleHttpRequest(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
    PrintWriter out = res.getWriter();
    res.setContentType("text/html");
    String qery=req.getParameter("qry");
    try
    Statement st=dbCon.createStatement();
    ResultSet rs= st.executeQuery(qery);
    while(rs.next())
    out.println(rs.getString(1));
    catch(SQLException e)
    System.out.println(e.toString());
    return;
    out.println();
    out.close();
    THE HTML CODE
    <html>
    <applet code = ReinApplet1.class width=500 height=300>
    </applet>
    </html>

    Since you are just using Strings, it's easier to use an ObjectOutput/InputStream. See http://forum.java.sun.com/thread.jsp?forum=33&thread=205887 for a detailed example.
    Cheers,
    Anthony

  • HELP URGENT : accessing servlets thru localhost

    Hi
    I am trying to access a servlet on iplanet from another servlet through forms .
    when i specifically give the machine name and point the form to
    <form name=form1 action=https://avenger/servlet/LoopQualServlet method=GET>")
    where avenger is my local machine it works fine and gets redirected .
    But when i try to do the same thing using localhost its not working..
    I gave
    <form name=form1 action=https://localhost:8443/servlet/LoopQualServlet method=GET>");
    Can someone pls help me figure where i am going wrong.???
    Thx in advance ..
    prabhu

    hi
    thx for the help.....Yes, both servlets are on the same iplanet server.I just tried the samething u said before seeing your post ...It worked....
    But one more question though.... I am trying to access the first servlet from the browser by typing https://localhost:8443/servlet/LoopQualPage...This then gets redirected to another servlet thru forms i discussed earlier...It doesnt work .
    But when when i try to say specifically https://avenger/servlet/LoopQualPage it works fine....
    Any clue how i can access the first one the same way i was able access the second one thru forms without actually typing the machine name???????
    Thx in advance
    prabhu

Maybe you are looking for