SSI with weblogic and JSP

Hi All
I am sorry, if my question sounds irrelevant.
1. Can we configure weblogic and apache to use server side includes (SSI) ? If yes please let me know how to do so.
2. Can I have SSI's in my JSP?
Thanks
Prashant

We have used mod_weblogic in apache and added
Option +Includes
for the location handled by Weblogic.
But still the SSI directives are not processed by apache.
Is there a way for apache to process SSI directives coming from Weblogic?

Similar Messages

  • How to master good design with EJB and JSP?

    I use JSP to calling EJB. But the .jsp file is complex and it's difficult to maintain...I just want to work higher efficent with EJB,JSP and JavaBean. I want to know is there a good design with EJB and JSP? and is there any good material about MVC for EJB,JSP and JavaBean?

    You should read the J2EE blueprint available on this website. Better download the PDF, and print it for yourself so you can read it anytime.

  • Where do I get started with OAS and JSP ?

    Where do I get started with OAS and JSP ?
    Resources?
    Please point me in the right direction!
    Post and/or email me at [email protected]

    The simplest way is to read OAS4082 Documentation:
    Developer's Guide: JServlet and JSP Applications.

  • Debuggin with WebLogic and VisualCafe

    I am developing Java Classes that run on WebLogic 5.1 using VisualCafe.
    Basically, I have a project that generates one jar file that WebLogic points
    to. I have JSP's that use classes in that jar file. I am trying to figure
    out how I can configure WebLogic and/or VisualCafe so that I can step
    through the code running on WebLogic when I call the JSP's. I played around
    with the remote debugging but could not seem to get it working. Any help
    would be appreciated.

    Hi ,
    It seems to be a issue with the environment variable CLASSPATH. To proceed further , Can you tell us the Weblogic and SOA verison which is installed on your machine / Server ? Also get us the value of your environment variables ORACLE_HOME ,  MIDDLEWARE_HOME , CLASSPATH & PATH.
    Thanks
    Lakshman

  • What is the role of J2EE compared with WebLogic and Tomcat?

    Now that J2EE play the role of Web Services Container and Logic Services Container
    What does WebLogic do?and What does Tomcat do?
    Do they collided with each other?

    WebLogic (and WebSphere, JBoss, and Sun ONE) are all J2EE application servers. Each of them has an HTTP server and servlet/JSP engines built-in. They can handle HTML pages, JSPs, EJBs, messaging, transactions, two-phase commit to databases, etc.
    Tomcat is just a servlet/JSP engine with an HTTP server built in. It can handle HTML pages, servlets, and JSPs, but it can't run EJBs for you. If you want to stick EJBs into a servlet or JSP, you'll have to get them from a J2EE app server.
    No, WebLogic is a superset of Tomcat. It has an HTTP server and a servlet/JSP engine, so WebLogic can happily exist without Tomcat.
    If you'd like, you can have both Tomcat and WebLogic. Let Tomcat handle the servlet and JSP requests and leave the EJB enterprise stuff to WebLogic. You might use this arrangement when you'd like to have a Tomcat server running in a DMZ and a WebLogic app server inside the second firewall. Tomcat can then do authentication and forward requests back to WebLogic. - MOD

  • Hibernate OR EclipseLink...Which is best with Weblogic and Oracle DB?

    Hi All,
    In my company, we are using Oracle DB and Weblogic application server. So in the process to upgrade or switch to new ORM, we shortlisted two options - Hibernate and EclipseLink.
    I gathered following summary regarding both ORMs -
    Hibernate:
    1.     When you need to train people, like we are going to do next week – most of the companies have Hibernate experts.
    2.     When you hire new developers, most of them come with specific Hibernate experience.
    3.     When you need to consult with experts, both in the internet or consultants, you have LOTS of options. Endless forums and communities all regarding Hibernate.
    4.     Hibernate is an open source which has a huge community. This means that it will be improved all the time and will push the ORM market forward.
    5.     Hibernate is an open source which means you have the code to handle, and in case needed, fit it to your needs.
    6.     There are lots of plugins to Hibernate, such as validations tool, audit tools, etc. These becomes standard as well and dismiss you from impl. things yourself.
    7.     One most important thing with ORM tool, is to configure it according to your application’s needs. Usually the default setting doesn’t fit to your needs.
    For that sake, when the market has a huge experience with the tool’s configuration, and lots of experts (see point 1 and 3) – most of chances you will find similar cases and
    lots of knowledge about how to configure the tool and thus – your application.
    EclipseLink:
    1. Fully supported by Oracle. Hibernate no. In case of pb, it could be cumbersome to prove that it is a pure Weblogic one. Concretely, we will have to prove it (waste of time and complexity).
    2. Eclipse link is developed by Oracle and the preferred ORM in the Weblogic /Oracle DB world.
    3. Even if at a certain time EclipseLink was a bit late compared to Hibernate (feature), EclipseLink evolved very fast and we can consider now that they close the gap.
    4. No additional fee as soon as you have Weblogic license. You will need to pays additional fee if you want some professional support on Hibernate.
    5. We are currently relying on Hibernate for our legacy offer and are facing pb in second level cache (JGroups). Today, we are riding off this part!. Consequences are limitation in clustering approach (perf)
    6. On EclipseLink side we do succeed to manage first and second level cache in a clustering approach.
    7. Indeed Hibernate is open source, so you can imagine handling it. In reality, the code is so complex that it is nearly impossible to modify it. Moreover as it is LGPL, you need to feedback all the modified sources to the community systematically.
    8. All tests performed by Oracle concerning Weblogic are using EclipseLink. Moreover, Oracle says that some specific optimizations are done to manage Oracle DB.
    9. Hibernate comes from JBoss community.
    Right now we are preferring Hibernate but there are concerns/reasons like EclipseLink developed by Oracle and preferred ORM in Webogic/ Oracle DB world (compatibility of ORM with DB and App. server), support comparison with both ORM, which are preventing to finalize the decision.
    Please help me with you views and opinions and share you experience with us so that we can make a perfect decision.
    If you want you can also reply to me @ [email protected].
    Thanks.

    The way the ORMs are designed, integration with application servers are relatively simple, and all provides the same features. Also since WebLogic have been around for a while, all ORMs are all well tested in this configuration.
    Hibernate has lot more users, and is likely very often used with Oracle DB, so you can expect not much bug against Oracle DB, maybe even less bug than EclipseLink, which is not much used. EclipseLink does provide support for some esoteric Oracle DB features like hierarchical and flashback queries.
    OpenJPA and DataNucleus are also JPA compliant. It’s likely that Open JPA has a higher user base than EclipseLink, so less unknown bugs.
    Oracle paying support is well known to be a bad joke. It’s a negative return to use this channel, even if they would be free. So in reality, you end up to use the open (free) forum to get support.
    What’s was lacking with Hibernate before is Dynamic Fetch Planning, but they now have some support, see http://opensource.atlassian.com/projects/hibernate/browse/HHH-3414. OpenJPA was the first to implement this must have.
    EclipseLink has query in memory, which can be used, but the API do not help to leverage it, and EclipseLink’s leadership made it clear that they are not going to make it better, instead they want to push Coherence cache.
    Hibernate has an open API for second level cache, which mean you can get out of problem by using another implementation, for example, EHCache seems to be professionally tested, so I would be surprise you find obvious bugs.
    I cannot comment on Hibernate source code quality, but I can tell you that locking mechanism in EclipseLink is used to be very fragile, and many concepts are dispersed over the code base.
    The runtime monitoring of Hibernate have always been great due to the fact that JBoss have always been strong on JMX, EclipseLink has not much usable features on this.
    If I would be you, I would consider OpenJPA or Hibernate instead of EclipseLink, the main reason is that because EclipseLink has a so low user base, I have found lot of obvious bugs in production, like if I was the only user of it. Then, when I submitted bugs to the small development team, which do not encourage user base contribution, they were too busy trying to keep up adding the JPA interfaces on top of their existing proprietary APIs.

  • Creating FOrums with Servlet and JSP

    Hi everyone,
    Is there a good resource that explains how to build a forum using servlets and JSP technology?
    Regards,
    Basil Mahdi

    please let me know here if you find any useful resources...I am in the process of writing my own searchable threaded forum for my company with JSP's/servlets. It's a very slow process at the moment though...if I ever finish it, I'll gladly share it.

  • Connecting databeses with WML and JSP pages..!

    I need information about how to connect databases with wap technologies using wml and jsp , I am waiting your resources, codes and helps.. And I would like to remind you , I am beginner about this topic , Only things that I know are Jsp and WML , I have no experience about wap and how to combine wml and jsp , So please be helper while you send your messages , If all your messages contains much detailed and supported complete sources and files , it will more helpfull for me ..
    Thanks in Advance.
    P.S : 1- ) if you want to contact direclty , mail address : [email protected]
    2-) Don't post me complex references' URL , I have already made search on google,yahoo and etc

    Additionally , I would like to learn what I have to need for this project .. Now , I already have winwap wap emulator and Websphere Studio.. Do I need special wap server or something else to test my applications..
    Please , hurry up .. I really need your helps..
    Ergin

  • Developing Enterprise Apps with Weblogic and WebGain-Studio

    Hi everybody,
    Is anybody experienced in developing with Weblogic Server and WebGain-Studio
    What could be a good environment for working with these components ?
    Thanx,
    Markus.

    Thanks for your prompt reply. I have another question. I am very new to Java development.
    In our environment, WebLogic 10.3.6 and JDK1.7 are both 64-bit. However, developers' machine are 32-bit windows. They will have Weblogic server installed locally in their machines for development. Later, the codes will be deployed and run in the 64-bit environment.
    Thus, we are developing java program with 32-bit java and compile/run it with 64-bit java. Is it the right way to do it or do our developers need to use 64-bit windows?
    Edited by: nww on Sep 14, 2012 2:51 PM

  • Pagination with orcale and jsp

    hi, i m new to java can any one tell me how to do pagination with my this codes
    String sqlCount = null;
    String sql = null;
    sql = "select * from HOME_LEASE_ ";
    sqlCount = "select count(*)from HOME_LEASE_ ";
    Enumeration e = request.getParameterNames();
    int i = 0;
    while(e.hasMoreElements()){
    String name = (String)e.nextElement();
    String search = new String(request.getParameter(name)).toUpperCase();
    if(i != 0 && (!search.isEmpty())){
    sql = sql +" and " + name +" like'" + search + "%'" ;
    sqlCount = sqlCount + " and " name" like '" + search + "%'" ;
    }else if((!search.isEmpty()) && (i == 0) ){
    sql = sql + " where " + name +" like '" + search + "%'" ;
    sqlCount = sqlCount + " where " + name+" like '" + search + "%'" ;
    ++i;
    if((sql != null) && (sqlCount != null)){
    DataAccess dB = new DataAccess();
    Connection conn = dB.getConnection();
    Statement stmtCount = dB.createStmt(conn);
    ResultSet rsCount = dB.executeQuery(sqlCount,stmtCount);
    rsCount.next();
    Statement stmt = dB.createStmt(conn);
    ResultSet rs = dB.executeQuery(sql,stmt);
    <% if(rs == null)
    out.println("<h3>No data found</h3>");
    else
    //out.println(rs.next());
    while(rs.next()) {
    //out.println("inside the result set");
    out.println("<tr>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("phase") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("file_no") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getString("se") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getString("str") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getString("qrno") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getString("typ") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("perno") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getString("name") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("total_plot_area_ocp") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("TOT_PREM_AREA") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("total_construction") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getLong("chargbl_construction") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getLong("add_open_construction") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getLong("TOT_PREM_AREA") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getLong("plinth") + "</a></td>");
    out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getLong("std_plot_area") + "</a></td>");
    out.println("</tr>");
    dB.close(rsCount);
    dB.close(stmtCount);
    dB.close(rs);
    dB.close(stmt);
    dB.close(conn);
    }else{
    out.println("<center style=\"background-color:red\">Please enter values in text fields<h1></h1></center>");
    %>

    After examining your code, I think:
    You are not using JSP/HTML properly (using java to write out HTML). You can spend a tremendous amount of time with trial and error approaches in learning a technology and still not get much real understanding for your effort. I suggest a better use of those hours would be spent in reading a book on Java first, then a book on JSP. For a book on JSP, go to amazon.com and search for 'Javaserver pages'. Find a book that isn't too old and that has good reviews. Here is one (although its a bit dated):
    http://www.amazon.com/JavaServer-Pages-Edition-Hans-Bergsten/dp/0596005636/ref=sr_1_1?s=books&ie=UTF8&qid=1338821741&sr=1-1
    As far your database code goes, I suggest you read on-line articles on JDBC on how to get/use/close a database connection in a try/catch/finally block. The article will probably also help you write better SQL too. I don't think your question on pagination should be tackled until you learn JSP.

  • JMS with weblogic and jdeveloper IDE

    HI,
    I am a newbie to jms..could anyone provide me a sample tutorial to test and deploy a sample jms application using weblogic and jdeveloper IDE.
    Thanks,
    Amy
    Edited by: 838667 on Feb 22, 2011 2:50 AM

    ...I have a strong feeling this is a TIBCO-related issue where you're not doing the lookup the way TIBCO likes.

  • Please....help me....Weblogic and JSP

    I have the following jsp example. This jsp call a applet and set the pool and server values. This example is taken from www.weblogic.com documentation. I would like to know what is doing this jsp in the following sentence:
    <param name="weblogic_url" value="t3://localhost:7001">
    This is jsp code:
    <html>
    <head>
    <title>
    Phonebook Applet
    </title>
    </head>
    <body bgcolor=#FFFFFF>
    <font face="Helvetica">
    <h1>
    <font color=#DB1260>
    Phonebook Applet
    </font>
    </h1>
    <BLOCKQUOTE>
    This applet has been loaded using the Java 1.1.3 Plugin from a
    <font face="Courier New" size=-1><jsp:plugin></font> tag.
    The JSP servlet should have sent the appropriate browser plugin
    tags for your browser type. Try viewing the HTML source to see
    the tags, then try loading the same JSP from another browser,
    and view the HTML source again.
    </BLOCKQUOTE>
    <center>
    <jsp:plugin type="applet" code="examples.applets.PhoneBook1" codebase="/classes/"
    height="800" width="500" type="applet" jreversion="1.1.3"
    nspluginurl="http://java.sun.com/products/plugin/1.1.3/plugin-install.html"
    iepluginurl="http://java.sun.com/products/plugin/1.1.3/jinstall-113-win32.cab#Version=1,1,3,0"
    >
    <params>
    <param name="weblogic_url" value="t3://localhost:7001">
    <param name="poolname" value="demoPool">
    </params>
    <fallback>
    <font color=#FF0000>Sorry, your browser type is not supported!</font>
    </fallback>
    </jsp:plugin>
    </center>
    <p>
    <hr>
    <font size=-1>
    Copyright &copy; 1996-2000, BEA Systems, Inc. All rights reserved.
    </font>
    </font>
    </body>
    </html>
    Because I would like to call a applet and that applet does access to the DB, and i need to specify that line, but i don�t know how....before that it example i reached do the following jsp, which do a query a DB:
    <!doctype html public "-//w3c//dtd html 3.2//en">
    <html>
    <!-- Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.-->
    <head>
    <title>Query of Municipalities</title>
    </head>
    <body bgcolor=#FFFFFF>
    <font face="Helvetica">
    <h1>
    <font color=#DB1260>
    Municipalities List
    </font>
    </h1>
    <%@ page import="
    weblogic.db.jdbc.*,
    weblogic.html.*,
    java.sql.*
    " %>
    <p>
    <%
    Connection conn = null;
    try {
    Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:weblogic:pool:DESAPool");
    catch (Exception e) {
    e.printStackTrace();
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * from CAT_MUNICIPIO");
    ResultSetMetaData md = rs.getMetaData();
    int numCols = md.getColumnCount();
    %>
    <p>
    <center>
    <table border=1 cellspacing=2 cellpadding=0 width=400>
    <tr>
    <%
    for (int i = 1; i <= numCols; i++) {
    %>
    <td><font face="Helvetica"><b><%= md.getColumnLabel(i) %></b></td>
    <%
    %>
    </tr>
    <%
    while (rs.next()) {
    %>
    <tr>
    <%
    for (int i = 1; i <= numCols; i++) {
    %>
    <td><font face="Helvetica"><%= rs.getString(i) %></td>
    <%
    %>
    <%
    %>
    <%
    rs.close();
    stmt.close();
    conn.close();
    %>
    <p>Please call Mary with any updates ASAP!
    <p>
    <font size=-1>Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
    </font>
    </font>
    </body>
    </html>
    This jsp is accesible from:
    http://172.21.9.23/gep/alterno/ex_jsp/b1.jsp
    From the final jsp, I think that i have to change the following lines from the first jsp:
    <params>
    <param name="weblogic_url" value="t3://localhost:7001">
    <param name="poolname" value="demoPool">
    </params>
    by:
    <params>
    <param name="weblogic_url" value="t3://localhost:7001"> //Here is my doubt.What�s "t3:" meanning?
    <param name="poolname" value="DESAPool">
    </params>
    Could somebody help me please?.....
    Thanks in advance.....
    Mary

    look at this url you will understand
    http://www.weblogic.com/docs51/classdocs/urls.html
    n joy ....
    </ksenji>

  • Problem with JNDI and JSP in Tomcat

    Hi,
    Basically, what I've done is to use the Tomcat administration web
    application to create the DataSource, which looks like it populated the
    server.xml (see below). I then try to access the testconn.jsp, and am
    getting that "Name java:comp is not bound in this Context" error.
    I was wondering if anyone could tell me what I'm doing wrong?
    Thanks,
    Feri
    My Configuration:
    - Tomcat 5.0.19
    - MySQL 4.0.18-nt
    - mysql-connector-java-3.0.15-ga-bin.jar
    server.xml:
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    <!--Feri test JNDI-->
         <Context crossContext="true" debug="5" docBase="injury" path="/injury" reloadable="true">
         <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_injury_log." suffix=".txt" timestamp="true"/>
              <Resource name="jdbc/injury" auth="Container"
    type="javax.sql.DataSource">
    </Resource>
    <ResourceParams name="jdbc/injury">
         <parameter>
              <name>factory</name>
              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
         </parameter>
    <parameter>
    <name>username</name>
    <value>root</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>root</value>
    </parameter>
         <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
         <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost:3306/injury</value>
    </parameter>
         <parameter>
              <name>maxIdle</name>
              <value>30</value>
         </parameter>
         <parameter>
              <name>maxActive</name>
              <value>10</value>
         </parameter>
         <parameter>
              <name>maxWait</name>
              <value>10000</value>
         </parameter>
    </ResourceParams>
         </Context>
    <!--Feri test JNDI end-->
    </GlobalNamingResources>
    \webapps\injury\WEB-INF\web.xml:
    <resource-ref>
    <description>Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file.</description>
    <res-ref-name>jdbc/injury</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    \webapps\injury\testconn.jsp
    <%@ page import="java.sql.*" %>
    <%@ page import="javax.sql.*" %>
    <%@ taglib prefix="ct" uri="/injury" %>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
    <h1>Connection test</h1>
    <ct:connection name="jdbc/injury">
    <%
    Statement stmt= conn.createStatement();
    ResultSet rs;
    rs = stmt.executeQuery("select * from user");
    while (rs.next()){
    %><%=rs.getString(1)%><%=rs.getInt(2) %><br><%
    rs.close();
    stmt.close();
    %>
    </ct:connection>
    ConnectionTag.java
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import javax.naming.*;
    import javax.sql.*;
    import javax.sql.DataSource;
    public class ConnectionTag extends TagSupport implements TryCatchFinally {
    private Connection conn;
    // JNDI name of the connection
    private String name;
    public void setName(String name)
         this.name = name;
    public int doStartTag()
         throws JspException
         try {
         Context env = (Context) new InitialContext().lookup("java:comp/env");
         DataSource ds = (DataSource) env.lookup(name);
         if (ds != null)
              conn = ds.getConnection();
         } catch (Exception e) {
         throw new JspException(e);
         if (conn == null)
         throw new JspException("can't open connection " + name);
         pageContext.setAttribute("conn", conn);
         return EVAL_BODY_INCLUDE;
    public void doCatch(Throwable t)
         throws Throwable
         throw t;
    public void doFinally()
         try {
         Connection conn = this.conn;
         this.conn = null;
         pageContext.removeAttribute("conn");
         conn.close();
         } catch (Exception e) {
    Tomcat 5.0\conf\Catalina\localhost\injury.xml
    <?xml version='1.0' encoding='utf-8'?>
    <Context displayName="Injury" docBase="E:\Tomcat 5.0\webapps\injury" path="/injury" className="org.apache.catalina.core.StandardContext"
    cachingAllowed="true" charsetMapperClass="org.apache.catalina .util.CharsetMapper" cookies="true" crossContext="false" debug="0"
    mapperClass="org.apache.catalina.core.StandardContextMapper" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper" >
    <Resource auth="Container" description="Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file." name="jdbc/injury" type="javax.sql.DataSource"/>
    <ResourceLink global="jdbc/injury" name="injury" type="javax.sql.DataSource"/>
    </Context>

    Hi,
    First of all, you can find alot of information about this in the forum about jsp's.
    I think a good thing to do is not to put your context tag directly into the server.xml file.
    What you should do is create a context.xml file with the context-tag in it, and put it in the META-INF directory of your .war file. Upon deployment to tomcat5 this file will be extracted from the war, copied to the conf\enginename\hostname directory, and it will be renamed to contextName.xml.
    I think you are developing directly into the webapps directory, and I believe you should avoid that and use the deployment feature of the manager web-app or you should use the deployertool from you ide or standalone ant.
    anyway, for starters try to remove the context tag from the server.xml file as described above, and check out the jsp / jdbc forums for simular problems and answers.
    good luck

  • Need help with Tomcat and JSP

    Hi
    I'm a complete beginner with JSP, I have experience with Java, Dreamweaver and HTML, but I'm having alot difficulty understanding JSP.
    I tried doing out some of the tutorial examples but they don't seem to come out right on the browser.
    For Example the Code for Date
    <HTML>
    <BODY>
    <%
    // This is a scriptlet. Notice that the "date"
    // variable we declare here is available in the
    // embedded expression later on.
    System.out.println( "Evaluating date now" );
    java.util.Date date = new java.util.Date();
    %>
    Hello! The time is now <%= date %>
    </BODY>
    </HTML>
    Comes out as
    <% // This is a scriptlet. Notice that the "date" // variable we declare here is available in the // embedded expression later on. System.out.println( "Evaluating date now" ); java.util.Date date = new java.util.Date(); %> Hello! The time is now <%= date %>
    I know this probably really sounds like a stupid question but what could be the problem?

    Those it have to saved on the desktop, or in the Tomcat webapps folder or what?It has to be in a web application under tomcat. The easiest one to get up and running with basic jsp is the webapps/ROOT directory which is where the main index page is.
    [url http://www.coreservlets.com/Apache-Tomcat-Tutorial/]This one is a good basic guide to installing/getting it running.
    Also the tomcat documentation itself is reasonable good. Of specific relevance to you would be [url http://tomcat.apache.org/tomcat-5.5-doc/appdev/index.html]Application developers guide which explains the basic layout/structure of a web application.

  • Problems with filters and jsp pages.

    I have the following simple filter that checks if there is user information in the session object and redirects accordingly:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginFilter implements Filter
         public void init(FilterConfig filterConfig) {}
         public void destroy() {}
         public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
         throws IOException, ServletException
              System.out.println("filter");
              HttpSession session = ((HttpServletRequest)request).getSession();
              String action = request.getParameter("action");
              if(action != null && !action.equals("login") && !action.equals("wronglogin"))
                   if(session.getAttribute("username") == null)
                        ((HttpServletResponse)response).sendRedirect("index.jsp?action=wronglogin");
                        System.out.println("User not OK, kicking out...");
                   else
                        chain.doFilter(request, response);
                        System.out.println("User OK, letting in...");
              else
                   chain.doFilter(request, response);
    }The filter is mapped to an admin page with the name index.jsp. However, I get an error for every <% and %> tag in the file (there are quite a few) when I use the filter with the page. The page works fine without the filter, and the filter seems to work with pages without scriptlets (without the <% and %> tags). Here is the beginning of the error report:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 6 in the jsp file: /admin/index.jsp
    Generated servlet error:
    Syntax error on tokens, AnnotationName expected instead
    An error occurred at line: 6 in the jsp file: /admin/index.jsp
    Generated servlet error:
    Syntax error on tokens, delete these tokens
    An error occurred at line: 6 in the jsp file: /admin/index.jsp
    Generated servlet error:
    Syntax error on token ";", [ expected
    An error occurred at line: 6 in the jsp file: /admin/index.jsp
    Generated servlet error:
    Syntax error on token ";", [ expected
    An error occurred at line: 6 in the jsp file: /admin/index.jsp
    Generated servlet error:
    Syntax error on token ";", [ expected
    Jasper gives me many errors per <% and %> tag. As you can see there is a <% tag on line 6. Any idea, why this does not work?
    Thanks!
    Message was edited by:
    chincillya

    What is the JSP scriptlet code at line 6 ?
    By looking at the code we can identify if there are any syntax errors, otherwise we can't really guess what might be the problem.

Maybe you are looking for