Getting servlet class corresponding to jsp?

Hi,
          I'm running WebLogic 5.1, sp12 for Solaris. I was wondering if
          someone could provide me with a small snippet of java code that would
          tell me the class name, or at least path to the servlet class that
          corresponds to a jsp page. So, for example, if I knew my jsp path was
          /mypath/http/myapp/dummy.jsp
          it would be great to get the class name which, in this example, might
          be:
          jsp_servlet._myapp.__dummy
          Thanks in advance, Dave A.
          

Programmatically, I don't know of a way to do that in java.
          Bill
          "D. Alvarado" wrote:
          > Thanks for your reply, What if you wanted to get the classname of a
          > particular jsp from another jsp? For example, what if I wanted to
          > know the class name of "/mypath/http/myapp/dummy.jsp" if I'm writing
          > code in "mypath/http/myapp/another.jsp"?
          >
          > Thanks, Dave
          >
          > William Kemp <[email protected]> wrote in message news:<[email protected]>...
          > > this.getClass().getName() will give you the name of the class at runtime.
          > >
          > > Bill
          > >
          > > "D. Alvarado" wrote:
          > >
          > > > Hi,
          > > > I'm running WebLogic 5.1, sp12 for Solaris. I was wondering if
          > > > someone could provide me with a small snippet of java code that would
          > > > tell me the class name, or at least path to the servlet class that
          > > > corresponds to a jsp page. So, for example, if I knew my jsp path was
          > > >
          > > > /mypath/http/myapp/dummy.jsp
          > > >
          > > > it would be great to get the class name which, in this example, might
          > > > be:
          > > >
          > > > jsp_servlet._myapp.__dummy
          > > >
          > > > Thanks in advance, Dave A.
          

Similar Messages

  • How to reference a DatabaseHandler servlet class from a jsp file in Tomcat

    Trying to create a database connection in the jsp file in webapps\project folder by referencing the DatabaseHandler class in webapps\project\WEB-INF\classes.
    Here is the code in the jsp to make the connection:
    DatabaseHandler db = new DatabaseHandler() ;
    String sql = "SELECT password FROM cms_users WHERE user =" + userName ;
    java.sql.ResultSet rs = db . selectQuery( sql ) ;
    Here is the DatabaseHandler class:
    import java.sql.*;
    public class DatabaseHandler
         // instance variables - replace the example below with your own
    private Connection connection;
         * Constructor for objects of class DatabaseHandler
         public DatabaseHandler()
    String url = "jdbc:odbc:javadatabase";
    // Load the driver to allow connection to the database
    try
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    connection = DriverManager.getConnection( url );
    catch ( ClassNotFoundException cnfex )
    System.err.println( "Failed to load JDBC/ODBC driver." );
    cnfex.printStackTrace();
    System.exit( 1 ); // terminate program
    catch ( SQLException sqlex )
    System.err.println( "Unable to connect" );
    sqlex.printStackTrace();
    public ResultSet selectQuery( String query )
    Statement statement;
    ResultSet resultSet = null ;
    try
    statement = connection.createStatement();
    resultSet = statement.executeQuery( query );
    catch ( SQLException sqlex )
    sqlex.printStackTrace();
    System . exit( 1 ) ;
    return resultSet ;
    Here is the error i am getting when i try to run the jsp script:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 2 in the jsp file: /ValidateLogon.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\cms\ValidateLogon_jsp.java:47: cannot find symbol
    symbol : class DatabaseHandler
    location: class org.apache.jsp.ValidateLogon_jsp
    DatabaseHandler db = new DatabaseHandler() ;
    ^

    Just like in the class file you need to import any classes that you want to access in the JSP.
    http://java.sun.com/products/jsp/tags/11/syntaxref11.fm7.html

  • Deploying web application to OC4J  - servlet class not found

    Hi,
    Im trying to deploy war file with web application,
    that I run before on Tomcat.
    During deployment procces everything seems to be OK.
    But when I try to log on web, I get 500 error...
    log file:
    07/07/12 15:10:14.562 webapp1: Servlet error
    javax.servlet.ServletException: Error instantiating servlet 'org.apache.jsp.index_jsp'. Servlet class org.apache.jsp.index_jsp not found in web-application webapp1
    where org.apache.jsp.index_jsp is path from web.xml and servlet index_jsp.class is in
    Web-Inf/classes/org/apache/jsp/ dir.
    Any Idea?
    Thanks a lot.
    H.

    Hi Steve,
    thanks for your answer, because my question is quite stupid, I know.
    But I'm not so much interested in pre-translated jsp files dependences on java container.
    Yes, my application use some parts of catalina lib, but I would like to just get index.jsp
    and this compiled class (org.apache.jsp.index_jsp.class) is "catalina lib free" I think?
    Or should I change my build.xml?
    Thanks.
    H.

  • R separate personalization classes reqd 4  jsps managed by servlet portlet?

    My portlet is a servlet which manages multiple jsps. This servlet manages the session data as well as navigation between the pages. At the moment, I have separate personalization classes for each of the jsps. Each personalization class extends NameValuePersonalizationObject. The content on each of the jsps has to be managed within the portal.
    Do I need to have separate personalization classses or is it better to have one personalization class for all the jsps within my portlet ?
    Any help would be great, Thanks,
    Tara

    Hi,
    After going through your application scenario, i think you should use just one Personalization Class. A single class would suffice all the four JSPs.
    But, as you might be aware, a Preference Store can only store basic data types like String, boolean etc. Complex Data Types like Properties etc. cannot be stored directly using NameValuePersonalizationObject. If you are storing complex types, then you will have to extend this class & define methods to store & fetch data from this complex object into the Personalization Store.
    You might want to go through the following article which talks about Information Storage using Web Providers.
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/articles/overview.information.storage.html
    If there are any further issues, please get back.
    Regards,
    Abhinav

  • Get the class file name of the JSP page

    Hi
    I'm wondering how I can get the class name associated with the current JSP page...
    I found on this forum how get the name of current JSP page, but it doesn't help me...
    Thanks

    Hi,
    Sometimes I can be really dumb; of course, the solution is to call the getClass() method on the this object, and eventually store the Class object returned in the SessionBean file if it's necessary (in a SessionBean field/property, or in a parameter of a SessionBean's method).
    Sorry for this thread without any interest. :(

  • How do I get the URL of a jsp page which calls a servlet?

    I have a jsp page which will lead to a servlet, I can get the URL of the servlet, but how do I get the URL of the jsp page which lead to the Servlet in the servlet?

    You could try doing:
    request.getHeader("Referer");

  • Weblogic class corresponding to HTTPSession

    I am looking at a stress issue and wanted to know which weblogic class corresponds to a HTTPSession.
    I see the follwoing in my heap dump. Is it one of these classes or anything else?
    Class Name | Objects | Shallow Heap | Retained Heap
    weblogic.servlet.internal.session.MemorySessionContext| 14 | 1,120 | >= 3,495,016
    weblogic.servlet.internal.session.MemorySessionData | 38 | 5,472 | >= 3,483,824
    weblogic.servlet.internal.session.SessionData | 0 | 0 | >= 600
    Thanks,
    Sunil.

    Programmatically, I don't know of a way to do that in java.
              Bill
              "D. Alvarado" wrote:
              > Thanks for your reply, What if you wanted to get the classname of a
              > particular jsp from another jsp? For example, what if I wanted to
              > know the class name of "/mypath/http/myapp/dummy.jsp" if I'm writing
              > code in "mypath/http/myapp/another.jsp"?
              >
              > Thanks, Dave
              >
              > William Kemp <[email protected]> wrote in message news:<[email protected]>...
              > > this.getClass().getName() will give you the name of the class at runtime.
              > >
              > > Bill
              > >
              > > "D. Alvarado" wrote:
              > >
              > > > Hi,
              > > > I'm running WebLogic 5.1, sp12 for Solaris. I was wondering if
              > > > someone could provide me with a small snippet of java code that would
              > > > tell me the class name, or at least path to the servlet class that
              > > > corresponds to a jsp page. So, for example, if I knew my jsp path was
              > > >
              > > > /mypath/http/myapp/dummy.jsp
              > > >
              > > > it would be great to get the class name which, in this example, might
              > > > be:
              > > >
              > > > jsp_servlet._myapp.__dummy
              > > >
              > > > Thanks in advance, Dave A.
              

  • 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?
    }

  • How to use self-defined class in a jsp page

    Hello:
    I defined a class for displaying purpose, which is in the different folder(WEB-INF/classes) from my JSP page.
    In my JSP page, I want to create an instance of my class and display something, while I get the following error: "
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 12 in the jsp file: /htmls/templateIntro.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    /home/jiao/jsp_webserver/tomcat/work/Standalone/localhost/syllabus/htmls/templateIntro_jsp.java:72: cannot resolve symbol
    symbol : class Display
    location: class org.apache.jsp.templateIntro_jsp
    Display display=new Display(out);"
    How can I solve this problem? Should I redefine my classpath or there are some other actions I should take.
    T.I.A.
    Oriental Spirit

    Here is what I have done:
    1) in Display.java, add one line "package tools;" on the top, and compile it to
    create Display.class.
    2) create a new folder at
    /home/jiao/jsp_webserver/tomcat/webapps/syllabus/WEB-INF/classes
    named tools and then put the Display.class into the newly created folder.
    3) in my jsp page, add " import="tools.*"
    But it still doesn't work.
    Any ideas? T.I.A.

  • How to use Classes stored in "Classes" folder in JSP with tomcat ?

    Hello friends
    im using tomcat as server and MySQL as a Backend. now i am using the date calculation in Diff.class files which i have stored in catalina_home/webapps/prj_dev/Prj_files/classes/diff/DIff.class.
    now i am getting error that :
    Generated servlet error:
    Only a type can be imported. diff.Diff resolves to a package
    wht i have to do ?

    I don't include the "classes" word in my import anymore.. Waa.. I'm going nuts.. T.T
    Now, I'm trying to use the class through useBean..
    this is how my application looks like:
    /webapps
    -----/hangman-jsp
    ------------index.jsp
    ------------/WEB-INF
    -------------------web.xml
    -------------------MysteryPhrase.java
    -------------------/classes
    ---------------------------/beans
    ----------------------------------MysteryPhrase.class
    -----------/images
    -------------------hangman.gif
    This is what is in my MysteryPhrase:
    package beans;
    import java.lang.String;
    import java.lang.StringBuffer;
    public class MysteryPhrase {
         private String answer;
         private StringBuffer mysteryPhrase;
         private int guesses;
         private char[] alphabet;
         public MysteryPhrase () {
         this.alphabet = new char[26];
    public void setMysteryPhrase (String mysteryPhrase) {
         this.answer = mysteryPhrase;
         this.mysteryPhrase = new StringBuffer(mysteryPhrase.length());
         for (int i = 0; i < mysteryPhrase.length(); i++) {
              this.mysteryPhrase.setCharAt(i, '_');
    public void setGuess (char guess) {
         for (int i = 0; i < answer.length(); i++) {
              if (answer.charAt(i) == guess) {
                   mysteryPhrase.setCharAt(i, guess);
         guesses++;
    public String getMysteryPhrase () {
         return mysteryPhrase.toString();
    public String getAnswer () {
         return answer;
    public int getGuesses () {
         return guesses;
    This is what is in my index.jsp (It is not yet finished..I just started..)
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <jsp:useBean id="phrase" class="beans.MysteryPhrase"/>
    <jsp:setProperty name="phrase" property="MysteryPhrase" value="Hello!"/>
    <html>
         <head>
              <title>JSP/JSTL Implementation of Hangman</title>
              <style type="text/css">
                   div {
                        color: white;
                        background-color: gray;
                        position: absolute;
                        border-style: solid;
                        border-width: thin;
                        width: 20%;
                        height: 30%;
                        text-align: center;
                   #guessBoard {
                        top: 28%;
                        left: 42%
                   #mysteryPhraseBoard {
                        top: 50%;
                        left: 25%;
                        z-index: 2;
                   #statisticsBoard {
                        top: 57%;
                        left: 58%;
                        z-index: 2;
                   #categoryBoard {
                        top: 23%;
                        left: 10%
                   #hangman {
                        top: 7%;
                        left: 70%;
                   #char {
                        width: 20px;
                   body {
                        background-color: black;
              </style>
         </head>
         <body>
              <div id="categoryBoard">
                   <form method="post">
                        Please choose a category:
                        <select name="category">
                             <option>Category 1</option>
                             <option>Category 2</option>
                             <option>Category 3</option>
                             <option>Category 4</option>
                             <option>Category 5</option>
                             <option>Category 6</option>
                             <option>Category 7</option>
                             <option>Category 8</option>
                        </select>
                        <input type="submit" value="Change"/>
                   </form>
              </div>
              <div id="mysteryPhraseBoard">
                   The mystery phrase is
              </div>
              <div id="guessBoard">
                   <form method="post">
                        Enter a letter: <input id="char" type="text" name="letter"/>
                        or
                        Enter a word: <input type="text" name="word"/>
                        <input type="submit" value="Guess"/>
                   </form>
              </div>
              <div id="statisticsBoard">
                   Guesses: 0
                   Remaining Letters: 8
              </div>
              <div id="hangman">
                   <img src="images/hangman.gif"/>
              </div>
         </body>
    </html>

  • How do I get the URL of a jsp page?

    I have a jsp page which has a link to a servlet page, in the servlet page, I want to get the URL of the jsp page.
    I tried to use request.getHeader("referer"), it seems like if it is a link in the jsp directly lead to the servlet, it works, but if the link calls a javascript function which opens up a window runing the servlet, it is not working. I have to do the second way, so it is not working by doing request.getHeader("referer")
    I tried to use javascript "location.href", I get the whole url by alerting the url in the jsp page:
    http://localhost:8080/pos-webapp/serv/qt_old?currentpage=portal&bcd=ABC123&pnm=P1001830&prnm=1&psd=236863.0&ln=01&sln=NYPPA&stp=2.1&stt=A&_POSID=1F8464122ADAF4EEC9B1A94C286EB252
    then I pass this url when calling with my servlet, in the servlet page, when I do request.getParameter("url"), the url is actually cut off like this:
    http://localhost:8080/pos-webapp/serv/qt_old?currentpage=portal
    anything after &pnm is cut off, anyone has any idea?
    Thanks in advance.

    Thank you.
    but how do I put encoding in the javascript code? do I need to decode in my servlet page?
    here is my code in the jsp page:
    linkset[3]+='<div class="menuitems">Email Diagnostics to AutoOne</div>'<%     
    function emailDiagnostics()
    win = window.open("/pos-webapp/serv/email_diagnostics?url=" + location.href + "&browser=" + navigator.appName, "emailDiagnostics",
    "width=350, height=140, resizable=no, scrollbars=no, toolbar=no, location=yes, directories=no, status=no, menubar=no, copyhistory=no, left=450, top=300");
    win.focus();
    }

  • Can a single servlet process 2 diffrent jsp pages?

    I am kinda new to the jsp world. Here is the question i have.
    I have 2 jsp pages and a sigle servlet class. Both the jsp pages need to be processed by the same servlet. The servlet needs to run diffrent logics based on which jsp the request is being sent from. Is there any way for the servlet to know which jsp the request is coming from( like having an attribute in the form tag of the jsp which the servlet can later retrieve)?
    I am using only jsp's and servlet( not using any other technology like struts or JSf's). I appreciate any kind of help. Thank you.

    Yes, you can! It depends on how you access the servlet. If you access it via GET method you must add a request parameter to the url to distinguish from which jsp the request comes. If you use POST method (with form submission) put a hidden field in the form and with that field you can recognize from which jsp the request comes.
    Message was edited by:
    amittev

  • RE:How to call a constructor or a .class file using jsp?

    try like this:
    <%@page import="folder_name.*%>
    <jsp:useBean id="info" class="folder_name.class_name"
    />
    now use your code:
    <%info.method_name()%>But my GetInfo class reside in this following folder!!!
    GetInfo.class location:
    D:/jakarta-tomcat-4.1.24/webapps/chart/WEB-INF/classes/GetInfo.class
    Configuration.jsp location
    D:/jakarta-tomcat-4.1.24/webapps/chart/Configuration.jsp
    This effectively means that I do not have a folder!!
    So I put in this
    <jsp:useBean id="info" class="GetInfo" />
    <%info.SetElement("VISUAL");
    info.startXML();
    String Visual = info.ReturnVISUAL();%>
    <%=Visual%>
    and get the following error:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac] D:\steve\jakarta-tomcat-4.1.24\work\Standalone\localhost\chart\Configuration_jsp.java:60: cannot resolve symbol
    [javac] symbol : class GetInfo
    [javac] location: class org.apache.jsp.Configuration_jsp
    [javac] GetInfo info = null;
    [javac] ^
    [javac] D:\steve\jakarta-tomcat-4.1.24\work\Standalone\localhost\chart\Configuration_jsp.java:62: cannot resolve symbol
    [javac] symbol : class GetInfo
    [javac] location: class org.apache.jsp.Configuration_jsp
    [javac] info = (GetInfo) pageContext.getAttribute("info", PageContext.PAGE_SCOPE);
    [javac] ^
    [javac] D:\steve\jakarta-tomcat-4.1.24\work\Standalone\localhost\chart\Configuration_jsp.java:65: cannot resolve symbol
    [javac] symbol : class GetInfo
    [javac] location: class org.apache.jsp.Configuration_jsp
    [javac] info = (GetInfo) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "GetInfo");
    [javac] ^
    [javac] 3 errors
    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
    at ConfigurationServlet.service(ConfigurationServlet.java:80)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
    at java.lang.Thread.run(Thread.java:536)
    then I put in this code:
    <%@page import="GetInfo.*"%>
    <jsp:useBean id="info" class="GetInfo" />
    <%info.SetElement("VISUAL");
    info.startXML();
    String Visual = info.ReturnVISUAL();%>
    and get the following error:
    org.apache.jasper.JasperException: /Configuration.jsp(19,21) equal symbol expected
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126)
    at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:169)
    at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:136)
    at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:149)
    at org.apache.jasper.compiler.ParserController.figureOutJspDocument(ParserController.java:254)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:173)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
    at ConfigurationServlet.service(ConfigurationServlet.java:114)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
    at java.lang.Thread.run(Thread.java:536)

    Okay, Tomcat doesn't like it when you don't use packages in the WEB-INF/classes folder, don't ask me why, it's just the way it is.
    Rewrite your class so it exists in a package:package myclasses;
    public class GetInfo { ... }Compile it and put it in the WEB-INF/classes directory so you should have:
    WEB-INF/classes/myclasses/GetInfo.class
    Your import statement should be:<%@ page import="myclasses.GetInfo" %>and continue coding as before.
    Let me know how it goes.
    Anthony

  • How to instantiate a .class from a JSP?

    Hi,
    probably it's a simple problem, byt I'm new in JSP and I couldn't work it out.
    I'm converting a SSJS Netscape Application to JSP. My needing is to write a Java .class containing only static methods, to call them from the JSP pages.
    For trying, I wrote a simple class that I call from a JSP page, but I get this error:
    Error: 500
    Location: /JSP24H/cap01/Simple2.jsp
    Internal Servlet Error:
    org.apache.jasper.JasperException: Unable to compile class for
    JSPC:\tomcat\work\localhost_8080%2FJSP24H\_0002fcap_00030_00031_0002fSimple_00032_0002ejspSimple2_jsp_0.java:80:
    Incompatible type for =. Can't convert void to java.lang.String.
    v = GenFunction.messaggio();
    ^
    This is the JSP instantiating the Java class:
    <HTML>
    <HEAD><TITLE>A Simple JSP</TITLE></HEAD>
    <BODY>
    <FONT COLOR="blue" FACE="Trebuchet">
    <CENTER>
    <%@ page import = "GenFunction" %>
    <% out.println("My name is Charly !" + "<br>"); %>
    <%
    String v = " ";
    v = GenFunction.messaggio();
    out.println( v );
    %>
    </CENTER>
    </FONT>
    </BODY>
    </HTML>
    And this is the class instantiated from JSP:
    public class GenFunction {
    public static void main (String args[]) {
    public static String messaggio() {
    String a;
    a = " Hello world !";
    return a;
    In order to be sure about what I'm doing, I opened a DOS window and I called the class within the following:
    public class call_Class {
    public static void main (String args[])
    String v;
    GenFunction x = new GenFunction();
    v = x.messaggio();
    System.out.println(v);
    When I instantiate the class from DOS it's all right, why not from JSP. It seems to be returning a void value (I tried with casting too but without success).
    Thanks !

    Do you have multiple versions of classes in the server CLASSPATH somehwhere? If you have changed the class, and not bounced the server, try bouncing the server(may be using cached class)
    -Mak

  • Getting servlets to work in the directory you want

    Ok, I've searched for a few hours and spent more time that I should with Tomcat, and I'm sure others have asked similar questions, but I'm still unable to solve a simple problem:
    I installed Tomcat (4.0.4), edited the path (common/lib) and classpath (servlet.jar).
    JSP files work beautifully, as do the example servlets. Even when I created a servlet and put it into /webapps/ROOT/WEB-INF/classes/myServlet it worked well. But when I tried to create my own directory, i.e. /webapps/ROOT/my-directory/WEB-INF/classes/myServlet I keep getting the 404 error of death.
    I tried to add a context line to the server.xml file, but Tomcat will not restart properly. Is there a special place within the file to add it? Or is there something else I'm missing?
    Am I correct in saying that you EITHER put a line into the classpath OR server.xml? I tried the line in the classpath with no success. Or is it something to do with web.xml - I played with it but again no success.
    Thanks,
    Dan
    PS I AM aware you must call the servlet file by using "servlet/myServlet"

    Well damn, after re-installing Tomcat 4.0.4 and doing it all again, it worked! Thanks to both of you for your help!
    SO maybe for others (or for myself when I forget later) I did the following:
    1. Installed Tomcat 4.0.4 in C:\Tomcat
    2. Set the classpath:
    .;C:\Tomcat\common\lib\tools.jar;C:\Tomcat\common\lib\servlet.jar;%Classpath%;
    3. Set the path: C:\Tomcat\common\lib
    4. Set CATALINA_HOME=C:\Tomcat
    5. Put my jsp,html files in /webapps/my-directory, created WEB-INF/classes and put the servlet classes in there
    6. Added the context in server.xml: <Context path="/my-directory" docBase="my-directory" debug="0" privileged="true" reloadable="true" />
    7. Added the web.xml file:
    <?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>
    Test
    </servlet-name>
    <servlet-class>
    Test
    </servlet-class>
    </servlet>
    </web-app>
    That's it! I hope I didn't miss anything...but it worked for me with a little help from my friends.
    PS I really think there should be better instructions... I consider myself a fairly good java developer, but getting this s@#! to work took too long ;)
    Dan

Maybe you are looking for

  • Images in text column to move?

    Hi, I placed an image over a column of text and used the text wrap tool. Now, is there a way for the image to move and shift down and keep in place with the copy as I add more text either before or after this article? I'm imagining, some sort of link

  • RDS 2012 App-V 5 SP2, Applications are not pinned in the Metro Start Menu

    Hey All, I've been building a new App-V 5 Environment using server 2012 R2 for the App-V management\Publishing\Reporting servers. I've installed app-v 5 SP2 on the RDS 2012 R2 servers and installed the App-V 5.1 SP1 Hotfix (KB2897087) for the 2012 R2

  • Will ipad 2 be faster in ios 8

    ios 8 is making my ipad 2 slow. will in the future this problem be rectified?

  • [IDCS2 Win]Indesign Crashes after Reading Swatches Panel!

    Hi,<br /><br />I have to get the count of Swatches that are "clicked or selected" in the Swatches Panel.<br /><br />Here is the Code i tried:<br /><br />InterfacePtr<IApplication>application(gSession->QueryApplication());<br />          <br />Interfa

  • Exchange Edge Server - 2010 (helpdesk to view queue viewer)

    Setup - Exchange Server Edge 2010 running in DMZ Question: Created a local account for Helpdesk team, allowed RDP permission to them, they unable to view Queue Viewer, getting an error message "couldn't find the enterprise organization container' Wha