Servlet controller unavailable

I am getting the error as follows in my web application.Can anybody tell me the reason.Thanks in advance
HTTP Status 503 - Servlet controller is currently unavailable
type Status report
message Servlet controller is currently unavailable
description The requested service (Servlet controller is currently unavailable) is not currently available.
Apache Tomcat/4.1.27

Are you sure you have mentioned the servlet in the web.xml file.
This web.xml file lets Tomcat know which servlets exist and where to look for it.
So, you should have the following tags in the web.xml file of your web application.
<servlet>
<servlet-name>MopoController</servlet-name>
<servlet-class>org.gertcuppens.controller.MopoController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MopoController</servlet-name>
<url-pattern>/MOPO</url-pattern>
</servlet-mapping>

Similar Messages

  • Implementing session handling in servlet controller

    how to implementing session handling in servlet controller.
    instead of writing isNew() in every jsp page i wanted to write in my central controller ,where each request is passing through controller. can any body give me the solution

    i tried it it is failed because first time the request is coming to the controller.it checks for new since of it is a first request it is forwarded to the login page.how to avoid or skip the condition checking when the request is first time.

  • How to print out the exception caught in the servlet controller to JSP?

    May I know how to print the Exception caught and the stacktrace thing? What i try to do this in the databaseErrata.jsp code was not given me any answer. Instead, causing a number of errors.
    Below are my servlet controller code and databaseErrata.jsp code.
    ----$CATALINA_HOME/webapps/mvct/WEB-INF/classes/Action.java----
    import java.io.*;
    import java.sql.*;
    import java.text.*;
    import javax.naming.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import foo.*;
    public class Action extends HttpServlet
      public void doGet(HttpServletRequest request,
    HttpServletResponse response)
        throws ServletException, IOException
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        // find real web resource
        String forward = request.getServletPath();
    //'forward' is a string variable consist of url
        if(forward.endsWith(".do"))
          forward = forward.substring(1, forward.length()
    -3) + ".jsp";
        else
          throw new ServletException(
          "Action servlet called with illegal path: " +
    forward); //display the defined error msg and error
    url within the 'forward'
    out.println("forward after forward.substring() = " +
    forward + "</br>");
        // build and validate view page attributes
        HttpSession session = request.getSession();
        try
          byEmployeeId convert =
    (byEmployeeId)session.getAttribute("convert");
          if(convert == null)
            session.setAttribute("convert", convert = new
    byEmployeeId());
          convert.start("11145");
        catch(NamingException ex)
          request.setAttribute("exception", ex);
          forward = "databaseError.jsp";
        catch(SQLException ex)
          request.setAttribute("exception", ex);
          forward = "databaseErrata.jsp";
        catch(IllegalArgumentException ex)
          request.setAttribute("message", "<FONT COLOR='red'>"+ex.getMessage()+"</font>");
        // forward request
        RequestDispatcher rd =
    request.getRequestDispatcher(forward);
        rd.forward(request,response);
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
        throws ServletException, IOException
          doGet(request, response);
    }----$CATALINA_HOME/webapps/mvct/databaseErrata.jsp----
    <% String message = (String)request.getAttribute("message"); %>
    <HTML>
    <HEAD>
    <TITLE>databaseErrata.jsp Page</TITLE>
    </HEAD>
    <BODY>
    <% if (message != null) { %>
    Message = <%= message %>
    <H1>databaseErrata.jsp Page</H1>
    </BODY>
    </HTML>

    You're missing a closing curly bracket in the JSP page.
    Also, this will only print the exception message. I would recommend passing on the whole Exception object.
    ie request.setAttribute("theException", ex);
    That way you have the exception object to print the stacktrace from.
    However, you are doing this manually. The container can handle this stuff for you if you so wish.
    Check the documentation on error pages. You are able to set up an error page in the web.xml, that all exceptions/errors get directed to.
    something like:
    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/errorPages/debugError.jsp</location>
    </error-page>
    You then write the JSP page something like this
    <%@ page language="java" %>
    <%@ page isErrorPage="true" %>
    <%@ page import="java.util.*, java.io.*" %>
    <h1>Programming error <BR> FOR DEBUGGING PURPOSES ONLY</h1>
    <p>This page is only for debugging purposes.  Should not be deployed to live environment.</p>
    <p>Details of the error are as follows:</p>
    <table border = 1 width=200>
    <tr><td valign=top><strong>Error :</strong></td><td><%=exception.getMessage()%></td></tr>
    <tr><td valign=top width='80%'><strong>Trace :</strong></td><td><pre><% exception.printStackTrace(new PrintWriter(out));%></pre></td></tr>
    </table>
    <br>Cheers,
    evnafets

  • Servlet Currently Unavailable !!

    Hello,
    I created a new web application in Apache tomcat. I put a HelloWorldExample servlet in Web-inf/classes folder. Then i put an entry into the web.xml file. When i invoke the servlet i get "Servlet Currently Unavailable No.503 "
    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>First Examples</display-name>
    <description>
    My Example servlets and JSP pages.
    </description>
    <!-- Define servlets that are included in the example application -->
    <servlet>
    <servlet-name>firstServlet</servlet-name>
    <servlet-class>firstServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>HelloWorldExample</servlet-name>
    <servlet-class>HelloWorldExample</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>
    servletToJsp
    </servlet-name>
    <servlet-class>
    servletToJsp
    </servlet-class>
    </servlet>
    <servlet>
    <servlet-name>
    CompressionFilterTestServlet
    </servlet-name>
    <servlet-class>
    compressionFilters.CompressionFilterTestServlet
    </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/</url-pattern>
    </servlet-mapping>
         <servlet-mapping>
    <servlet-name>
    CompressionFilterTestServlet
    </servlet-name>
    <url-pattern>
    /CompressionTest
    </url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>
    servletToJsp
    </servlet-name>
    <url-pattern>
    /servletToJsp
    </url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>firstServlet</servlet-name>
    <url-pattern>/firstServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>HelloWorldExample</servlet-name>
    <url-pattern>/HelloWorldExample</url-pattern>
    </servlet-mapping>
    </web-app>
    Hoping for ur replies
    Mani.

    Hi
    Your servlet must be in package and change your web.xml
    <servlet>
    <servlet-name>HelloWorldExample</servlet-name>
    <servlet-class>packagename.HelloWorldExample</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorldExample</servlet-name>
    <url-pattern>/HelloWorldExample</url-pattern>
    </servlet-mapping>Try this i hope, it will help you
    bye for now
    sat

  • How to get javabean data in Servlets.( JavaBean -- Servlet(Controller)

    how to get javabean data in Servlets.
    1) I am using name ,password in Jsp(View )
    2) when I submit this Bean will be called and Setter methods will be called .
    3) In ServletController (controller) I want to get data of javabean.
    In this I have to do validation of user.
    I want to pass the javabean obj as like -->
    request.getAttribute("beanObj");
    My intention is to get all the poperties in javabean by passing bean id
    or beanobj ,
    Is there any way to get all the data using bean id or beanObj.
    Plz Reply,

    Now in the Servlet we can get the same bean by this code:
    PageContext pageContext = JspFactoryImpl.getDefaultFactory().getPageContext(this, request, response, null, true, 8192, true);
    UserBean userbean = (UserBean)pageContext.getAttribute("userbean", PageContext.SESSION_SCOPE);
    String userid = userbean.getUsername();
    For this code to work it is needed to import 2 files:
    import org.apache.jasper.runtime.JspFactoryImpl;
    import javax.servlet.jsp.PageContext;
    The JspFactoryImpl is in jasper-runtime.jar file provided in tomcat dir.It seems to me that you are exactly knowing what you are doing :-(
    You can get a Bean stored in a Session by
    request.getSession().getAttribute("userbean");
    In the login.jsp page for example we have the code
    <jsp:useBean id="userbean" scope="session"class="com.newproj.UserBean" />
    <jsp:setProperty name="userbean" property="*" />the jsp:setProperty is not called when you click on the submit button
    if fills the bean with the request values from the previous request.
    andi

  • Help with servlet controller

    lets say I wanted to build a login function. The function needs to
    1) validate the form
    2) check the database to see if the u/p matches
    3) return the user to the next step
    What is the most efficent way to do this.
    login.jsp -> package.FormValidate(servlet) ->check.jsp -> package.DBCheck(servlet) -> check.jsp -> succeed.jsp
    or should their be one controller servlet which is called by the jsp page. The controller servet then calls the package.FormValidate servlet then the controller servlet calles the package.DBCheck servlet) then then controller servet send to either fail.jsp or succeed.jsp
    Do you see what I mean? When I build a logical function ,should jsp call each servlet or should their be a main "controller" servlet?
    thanks

    Use Struts to solve all these issues and let struts do the work for you...

  • Xgrid Controller Unavailable

    Podcast Producer and Xgrid live on the same box here and prior to Snow Leopard there was no trouble getting Podcast Producer connected to Xgrid. The server is connected to Active Directory, DNS responds correctly, user authentication is working fine, but it will not connect to Xgrid. I can connect to Xgrid with the Xgrid Admin tool using password authentication however.
    Kerberos is functioning, but I would prefer to use a local user, not a domain user to run Xgrid tasks, but "Xgrid Controller service is unavailable on mymachine.mydomain.edu" no matter what I set Xgrid User Name and Xgrid User Password to, even when Xgrid is set to password authentication.
    Any insight is appreciated. Thanks.
    -James

    Thanks David, that pointed me in the right direction at least.
    Since it is somewhat complicated to get such an account created for our Active Directory as it is not directly managed by our department, I decided to disconnect from AD and run open directory standalone. Now it all authenticates correctly via kerberos locally, although I still need to resolve other mysterious issues as to why Xgrid is failing about 3/4 through the tasks I submit.

  • Servlet marked unavailable

    Hi,
    I have a problem whereby whenever i run the servlet, my serlvlet was marked as unavailable. have Stripped down the servlet to bare minimum and was able to run it. It was only after i placed the following code that it was unable to run.
    +public void doGet (HttpServletRequest request, HttpServletResponse response, String additionalParameter) throws ServletException, IOException, Exception {+
    +     +
    +     int which = 0;+
    +     String name = request.getParameter( "name" );+
    +     try {+
    +          Oracle oracle = new Oracle(jdbcUrl, user, password);+
    +               +
    +               Attachment attachment = Attachment.createInstance(+
    +                         new String[] {}, "OWLPRIME",+
    +                         InferenceMaintenanceMode.NO_UPDATE, QueryOptions.DEFAULT);+
    +               +
    +               GraphOracleSem graph = new GraphOracleSem(oracle, modelName, attachment);+
    +               ModelOracleSem model3 = new ModelOracleSem(graph);+
    Part of the error is as follow:
    Jun 22, 2010 9:44:50 AM org.apache.catalina.core.ApplicationContext log
    INFO: Marking servlet ExpertFinderServlet as unavailable
    Jun 22, 2010 9:44:50 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Allocate exception for servlet MyServlet
    java.lang.ClassNotFoundException: com.hp.hpl.jena.rdf.model.Model
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
    Unable to find explaination or solution to this problem. Would appreciate any help here. Thank You.

    Hi,
    Looks to me that the Jena related jar files are not loaded by Tomcat. You should include them in the corresponding lib directory.
    Regards,
    Vladimir

  • Main servlet controller which handle every dynamic request

              Hello
              first of all, I experiments on weblogic 6 sp1
              I'd like to set in my webapplication a central servlet which will handle every
              dynamic call(every servlet). But I would like that it does not handle the static
              files (.gif, .pdf...)
              I used the <servlet-mapping> facilities in my web.xml file with the following
              value <url-pattern>/</url-pattern>, but in that case my servlet receive every
              request.
              In fact if my application context is "webapp", I would like to set a mecanism
              which route the following URL to my servlet :
              http://host:port/webapp
              http://host:port/webapp/whatever
              http://host:port/webapp/whatever?param1=value1
              but not these one
              http://host:port/webapp/file.gif
              http://host:port/webapp/file.pdf
              Thank you for your help
              

    You do not remove exceptions. You fix the cause of the exception.
    You said, it is caused by the Class#forName() call on the MySQL JDBC driver class? Is it a ClassNotFoundException? If so, then put the MySQL JDBC driver class in the classpath. It is available in the MySQL Connector/J JAR file which you can download from the manfacturer's website.

  • How can i make a servlet (class) temporarily unavailable, except for ADMIN

    Hello All!
    I am rather new to the programming field and have already completed a web-project in Java only with Servlets. (no jsp). I have a login procedure, means I have a user management for users and admins. If an admin is logged in, he/she should be able to deactivate the servlet with a mouse-click as long he activates it again with the same. if the servlet is deactivated, other users/admins trying to access the servlet should get a "servlet is currently unavailable" message. but the admin, who is logged in, still should be able to work with the servlet! how can i realise that?
    in other words, by clicking that particular button, the servlet should be made "non-multi-thread" and other way round by activating it.
    any ideas??? how can the standard "servlet currently unavailable" page be displayed? I have tomcat 4 on a linux machine! i'd be really grateful if someone oculd help me.
    another question i have is, how to define a "pseudo" link address to the servlet. now, the servlet can only be accessed by typing like this: http://servername.xy.com:8080/ProjectName/servlet/ServletName (because I have activated the servlet mapping in the server.xml/web.xml with /servlet/*)
    but I want a link like this: http://servername.xy.com:8080/shortname
    How can I do this in an easy way?? I have treid to create a web.xml in der WEB-INF folder of the servlet with following content, but it is not working:
    <?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>
    <servlet>
    <servlet-name>
    shortname
    </servlet-name>
    <servlet-class>
    ClassName
    </servlet-class>
    </servlet>
    </web-app>
    Thanks a lot in advance for your kind help,
    lisa

    Ok,
    You'll need to find a tutorial on servlet filters. Its not that hard a concept.
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Servlets8.html#wp64572
    Filters need to be configured in the web.xml.
    Basically they are a buffer between a request and your servlet.
    Any requests for the servlet, go through the filter first. It lets you do some processing before/after the servlet gets called. Its a good way of putting in some generic code that need to be run for many servlets - security checks are often implemented in this fashion.
    This should give you an idea of the sort of thing you need. I haven't really written one before, so I copied this out of the tutorial and did some basic framework for it....
    public final class TestFilter implements Filter {
       private FilterConfig filterConfig = null;
       public void init(FilterConfig filterConfig) throws ServletException {
          this.filterConfig = filterConfig;
       public void destroy() {
          this.filterConfig = null;
       public void doFilter(ServletRequest request,  ServletResponse response, FilterChain chain) throws IOException, ServletException {
            // if you want to get the session will need to cast request to an HttpServletRequest
            Session session = request.getSession();
            String requestURL = request.getRequestURL();
            // check if this URL is for a servlet that is disabled for this user
           // somehow you have to keep track of this ... maybe in the servletContext ?
        User user = (User) session.getAttribute("user")     
          boolean disabled = checkDisabled(requestURL, user);
          // if its not disabled, go ahead
          if (!disabled)
            chain.doFilter(request, response);
        else{
            // send the servlet off somewhere else - requestDispatcher maybe?
    }

  • Servlet Faces Servlet is currently unavailable

    Hi,
    I get the following error when deploying my webapp to Tomcat 4.0:
    [Thu Dec 18 12:03:16 EST 2003] stdout: StandardWrapper[DeployApp:Faces Servlet]: Marking servlet Faces Servlet as unavailable
    [Thu Dec 18 12:03:16 EST 2003] stdout: StandardContext[DeployApp]: Servlet /BULDeployApp threw load() exception: javax.servlet.ServletException: Wrapper cannot find servlet class javax.faces.webapp.FacesServlet or a class it depends on
    [Thu Dec 18 12:03:16 EST 2003] stdout: javax.servlet.ServletException: Wrapper cannot find servlet class javax.faces.webapp.FacesServlet or a class it depends on
    The jsf-ri.jar is copied in $tomcat_home/common/lib (to solve the ConfigListener error) and following libraries are a part of web-inf/lib:
    commons-beanutils.jar, commons-collections.jar, commons-digester.jar, commons-logging.jar, jsf-api.jar, jstl.jar, standard.jar.
    Please help.

    The jsf-ri.jar is copied in $tomcat_home/common/lib
    (to solve the ConfigListener error) and following
    libraries are a part of web-inf/lib:
    commons-beanutils.jar, commons-collections.jar,
    commons-digester.jar, commons-logging.jar,
    jsf-api.jar, jstl.jar, standard.jar.
    If you copy jsf-ri.jar into common/lib, you should copy all of the others as well (and remove them from your web application). However, you should also know that if you are really using Tomcat 4.0.x there are several class loader problems that will make it virtually impossible for this to run correctly. I would strongly recommend updating to Tomcat 5.0.16 (recently released stable implementation of Servlet 2.4 and JSP 2.0).
    It's also possible to get the beta release of JSF to work on Tomcat 4.1.29 (see the release notes for details) but you will need to be sure you're using JSTL 1.0 instead of 1.1.
    >
    Please help.Craig

  • Controller Servlet that Redirects to URLS

    Dear Members,
    I would like to do the following but I am not quite sure how to proceed.
    I have a website that has several pages (not just *.jsp but also *.html). I would like to have a servlet controller to sit on top of the website, so that without altering the WebPages, to monitor for each user session, the URL visited.
    In other words, say a user click on a link of one of the webpages. The controller should get the URL request, record it and then direct the user to where the link points.
    I have tried the following but it does not work.
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    ServletContext application = getServletContext();
    String reqUrl = getUrl(req);
    String checkUrl = reqUrl.substring(reqUrl.length()-2);
    if (checkUrl == ".jsp")
    RequestDispatcher dispatcher = application.getRequestDispatcher("/Welcome.jsp"); //nextURL
    dispatcher.forward(req,res);
    else
    res.sendRedirect(reqUrl);
    res.setStatus(res.SC_MOVED_TEMPORARILY);
    res.setHeader("Location", "reqUrl");
    public static String getUrl(HttpServletRequest req) {
    String reqUrl = req.getRequestURL().toString();
    String queryString = req.getQueryString(); // d=789
    if (queryString != null) {
    reqUrl += "?"+queryString;
    return reqUrl;
    -----------------------------------------------------------------------------------

    Sounds like you rather need a filter, read up on the javax.servlet.Filter interface.
    You can map a filter to urls in your web.xml like this:
    <filter>
      <filter-name>TestFilter</filter-name>
      <filter-class>test.TestFilter</filter-class>
    </filter>
    <filter-mapping>
      <filter-name>TestFilter</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>

  • How to Use Weblogic6.1 JAAS Sample in Servlet???

    Hi there,
    I am now developing JAAS security service based on weblogic. Here is the problem I met with:
    1. There is no problem when invoking JAAS sample from application.
    But Subject.doAs() is denied when moving the application to servlet.
    2. It is said that when invoking JAAS from servlet,
    an authenticated subject will be returned using:
    Subject subjectTest = loginContext.getSubject();
    How can I store the subject into the session and be called later?
    3. getUserPrincipal(), isUserInRole() are two important
    methods in authenticaion on web services.
    How is the user principal and role stored in the session?
    4. Where can I find some tutorials on invoking JAAS service from servlet?
    Thanks.
    ============================================================
    This is my source code
    package examples.security.jaas;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import java.io.*;
    import java.util.*;
    import javax.security.auth.Subject;
    import javax.security.auth.callback.Callback;
    import javax.security.auth.callback.CallbackHandler;
    import javax.security.auth.callback.TextOutputCallback;
    import javax.security.auth.callback.TextInputCallback;
    import javax.security.auth.callback.NameCallback;
    import javax.security.auth.callback.PasswordCallback;
    import javax.security.auth.callback.UnsupportedCallbackException;
    import javax.security.auth.login.LoginContext;
    import javax.security.auth.login.LoginException;
    import javax.security.auth.login.FailedLoginException;
    import javax.security.auth.login.AccountExpiredException;
    import javax.security.auth.login.CredentialExpiredException;
    public class SampleServlet extends HttpServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    doPost(req, res);
    System.out.println("1\n");
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    HttpSession session = req.getSession(true);
    res.setContentType("text/html");
    PrintWriter out = res.getWriter();
    System.out.println("2\n");
    String username = req.getParameter("username");
    String password = req.getParameter("password");
    String url = req.getParameter("url");
    LoginContext loginContext = null;
    Context ctx = null;
    try
    // Set server url for SampleLoginModule
    Properties property = new Properties(System.getProperties());
    property.put("weblogic.security.jaas.ServerURL", "http://localhost:7001");
    System.setProperties(property);
    property = new Properties(System.getProperties());
    property.put("weblogic.security.SSL.ignoredHostnameVerification", "TRUE");
    System.setProperties(property);
    // Set configuration class name to load SampleConfiguration
    property = new Properties(System.getProperties());
    property.put("weblogic.security.jaas.Configuration", "examples.security.jaas.SampleConfig");
    System.setProperties(property);
    // Set configuration file name to load sample configuration policy file
    property = new Properties(System.getProperties());
    property.put("weblogic.security.jaas.Policy", "Sample.policy");
    System.setProperties(property);
    // Create LoginContext; specify username/password login module
    loginContext = new LoginContext("SamplePolicy", new MyCallbackHandler());
    catch(SecurityException se)
    se.printStackTrace();
    System.exit(-1);
    catch(LoginException le)
    le.printStackTrace();
    System.exit(-1);
    System.out.println("SampleServlet:" + username + "\n");
    // Attempt authentication
    try
    // If we return without an exception, authentication succeeded
    loginContext.login();
    catch(FailedLoginException fle)
    out.println("Authentication Failed, " + fle.getMessage());
    System.exit(-1);
    catch(AccountExpiredException aee)
    out.println("Authentication Failed: Account Expired");
    System.exit(-1);
    catch(CredentialExpiredException cee)
    out.println("Authentication Failed: Credentials Expired");
    System.exit(-1);
    catch(Exception e)
    out.println("Authentication Failed: Unexpected Exception, " + e.getMessage());
    e.printStackTrace();
    System.exit(-1);
    // Retrieve authenticated subject, perform SampleAction as Subject
    out.println("Authentication succeeded " );
    System.out.println("===============start to trace333\n");
    Subject subject = loginContext.getSubject();
    System.out.println("Subject:"+subject.toString()+"\n");
    System.out.println("Subject.getclass:" + subject.getClass().getName());
    SampleAction sampleAction = new SampleAction();
    Subject.doAs(subject, sampleAction);
    System.out.println("4\n");
    // System.exit(0);
    ========================================================
    void doPost(
    HttpServletRequest req,
    HttpServletResponse resp) {
    Principal p =
    req.getUserPrincipal();
    auditCall(p.getName());
    if (req.isUserInRole(
    "ManagersRole")) {
    // Do some Manager stuff
    } else if
    (ctx.isUserInRole(
    "SalesRole")) {
    // Do some Sales stuff
    I'll describe where JAAS fits in to the web app model but please note that some of this should be automatically handled by your Servlet container.
    Servlet engine (or your MVC servlet controller) receives a request for a protected resource.
    It then checks for the existence of an "authenticated" token in the HttpSession.
    If that token doesn't exist then it forwards the user to the login page.
    The user fills in the form, and the login servlet receives the username and password at which point the JAAS Login Module is called with two callback objects: one that returns the username and one that returns the password.
    The JAAS Module checks to see if the credentials are valid, if not, it throws an authentication exception.
    Once control is returned to the Login Servlet, the Login Servlet would add the authenticated "Subject" to the HttpSession and if necessary, an authentication "token".
    So, JAAS is really only called ONCE, not for every web request, and it's called
    by the "logical" Login Servlet AFTER the user submits their login information.
    JAAS is not used to check for whether the user is authenticated already or not.
    the weblogic 6.1 server side exception
    username: joeuser
    password: joepass
    <May 25, 2002 11:05:20 PM PDT> <Error> <HTTP> <[WebAppServletContext(2169486,exa
    mplesWebApp,/examplesWebApp)] Servlet failed with Exception
    java.lang.SecurityException: Attempting Privileged Action With Unauthenticated S
    ubject
    at javax.security.auth.Subject.doAs(Subject.java:74)
    at examples.security.jaas.SampleClient.startWeb(SampleClient.java:200)
    at jsp_servlet.__poc1._jspService(__poc1.java:92)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >

    If anyone of you, has got any answers related to the above mentioned problem, Post it here, Will folks from SUN respond to this at any time.
    Regards
    Jayendran

  • Can a Servlet be used for Storing Objects with both JSP and JSF used on it?

    Hi,
    Pages I have:
    SearchEmployee.jsp
    This page has a search engine that search out the Employee. This Employee Object will be stored inside a Servlet(controller) for future references by other pages. I used JSP, html tags for forms, and request.getParameter() to built this search engine.
    Problem:
    I have a JSF Form that wants to DISPLAY the employee which I have found in my Search Engine. How can I get the JSF's value="#{Controller.employeeObj.name}" to get the value from the object?
    This seems logical as my JSF form is just retrieving the stored object in the Controller. I currently cant seem to output it

    The servlet shouldn't be used to store ANY data, let alone data to be accessed by other sevlets. Put the object into the Session object.

  • How to pass a JavaBean from servlet to JSP?

    Hi there,
    I am working on a project that needs to handle quite a few client requests and I want to use the Front Controller pattern that is described in the J2EE pattern page.
    The steps described in the front controller pattern is that:
    1. A servlet (controller) process the client request.
    2. It calls the appropriate cammand object and the cammand object gets the data from the data source and returns a JavaBean that contains the required data.
    3. The servlet dispatch to the appropriate View (jsp page)
    4. The JSP page displays the data in the JavaBean to the user.
    However, I don't know how to pass the JavaBean from the servlet to the JSP page when the servlet forwards the control to the JSP page. Should I make the JavaBean with a request scope or higher? If so, how to uses it in the JSP page? Just refer by the ID of the JavaBean.
    If any one knows there is an example or tutorial on how to use this pattern, please let me know.
    Thank you !
    Regards
    Edmund

    Could you please give more info? i tried to do this, but always get a "Class not found exception":
    response$jsp.java:65: Class org.apache.jsp.TestBean not found. TestBean bean = null;
    although the class TestBean (no package name => defalt package) is in the WAR file and the Servlet seems to instantiate it (otherwise an exception would occur sooner in the TestServlet code).
    my JSP code is:
    <%@ page language="java" info="Response page" %>
    <jsp:useBean id="bean" class="TestBean" />
    <%
    TestBean bean2 = (TestBean) request.getAttribute("TheBean");
    %>
    <html>
    <body>
    Your value: <%= bean2.getValue() %><BR>
    My val: <%= bean2.getNewValue() %><BR>
    <P>
    Date: <%= new Date() %>
    <P>
    Neuen Wert eingeben
    </body>
    </html>
    --------------

Maybe you are looking for

  • I'am having trouble with Photoshop Elements 12

    In Photo Elements 12 I can open the organizer but  not the Editor. I am afraid that if I uninstall and install again I will loose what I have edited on certain photos. Please help, I need to edit a few pictures and I can't do so.  Once I open it, it

  • How to see the image from server

    hi, I have uploaded an image to server using following code. I want to see the image from server now. When i open this page then it show image. But when i want to see this image from server then it shows blank. Whats the problem of my code? Give me s

  • Combobox visible depending on the selection in a previous combobox

    I've 5 Combo Box please help me to find a way to resolve my problem : i want that when I select in the first combobox, the second one becomes visible and the first one becomes invisible, and when i select in the second one, the third one becomes visi

  • Reports in Oracle HRMS

    hi all i have created a report in apps 11i in Oracle HRMS but i am getting the message "The file is damaged and could not be repaired" could anyone please tell me the reason

  • Is there a way to figure out what takes up a lot of memory using Spotlight?

    My 80 GB iMac apparently has 70 of the gigabytes used by various things on the computer, but I am at a loss as to what. My pictures take up about 15 GB and my music about the same, but even with that amount, I can't figure out where the other 50 have