JSP related

Hello and Good Evening,
I have been able to do a drop down list in JSP with the required data coming from a bean, however I would like to know how to actually pass what I have selected from the drop down list back to the bean as input to acquire another value to be displayed in the next field in my JSP?...could this be done without using javascript?
...I am very new at JSP, Struts and it's architecture...so actually working on the basis of trial an error, samples and reading up pass experiences of others(from forums) to get this done...time is of the essence for me at the moment.
Anyone's guidance would be greatly appreciated. Thank you.

What? A servlet gets generated from the jsp and in
tomcat, for example, all these servlets extend
HttpJspBase which extends
javax.servlet.http.HttpServlet and implements
javax.servlet.jsp.HttpJspPage,
javax.servlet.jsp.JspPage, java.io.Serializable,
javax.servlet.Servlet and
javax.servlet.ServletConfig. These generated servlets
also implement JspSourceDependent.does that mean there is a jsp class or simply that a jsp is converted into a class

Similar Messages

  • EXPRESS and JSP relation

    have got some basic doubtd in IDM
    We have XML and JSPs how both r getting related in
    the sense Take Login Form --> Login.jsp how both
    are gettign related
    Suppose In form1 I am entering some data that data
    if I want to recieve in form 2 How to specify the
    action ?
    It seems elementary
    Thanks in Advance
    senthilRajan

    I'm not really sure I understand your question.
    Although it's probably generally true that a JSP file maps to an XML form, it's not always the case.
    Can you be more specific about what you are trying to do? Are form1 and form2 different forms that would be presented during the processing of a workflow? Are you referring to end user vs. and admin activity?
    Often it can be easier to use a single form that nests fields within fields that can be conditionally disabled. Thus, a single form can look like multiple different forms. Or you can use tabs in the form spread fields out on multiple tabbed pages.
    Hope that helps,
    sbr

  • Ias6SP3 JSP relative include

    We are using "jsp:include" directive. (<jsp:include page="filename"
    flush="true"/>)
    Our experience is that relative filaname is not always working. It seems
    that the directory base of the subsequent includes are not interpreted
    relative to the current JSP, but relative to the root.
    Do we really need to review all the jsps and change it to absolute?
    Please cc me to your reply
    Gyorgy
    PS:
    According to the specification the JSP include directive should work in
    the following manner :
    Relative URL Specifications within an Application
    Elements may use relative URL specifications, which are called URI
    paths in the Servlet
    2.1 specification. These paths are as in RFC 2396 specification; i.e.
    only the path part, no
    scheme nor authority. Some examples are:
    myErrorPage.jsp
    /errorPages/SyntacticError.jsp
    /templates/CopyrightTemplate.html
    When such a path starts with a /, it is to be interpreted by the
    application to which the JSP
    page belongs; i.e. its ServletContext object provides the base context
    URL. We call
    these paths context-relative paths.
    When such a path does not start with a /, it is to be interpreted
    relative to the current JSP
    page: the current page is denoted by some path starting with / which
    is then modified by
    the new specification to produce a new path that starts with /; this
    final path is the one
    interpreted through the ServletContext object. We call these paths
    page-relative
    paths.
    The JSP specification uniformly interprets all these paths in the
    context of the Web server
    where the JSP page is deployed; i.e. the specification goes through a
    map translation. The
    semantics applies to translation-time phase (i.e. include directives,
    Section 2.7.6), and to
    request-time phase (i.e. to include, Section 2.13.4, and forward,
    Section 2.13.5,actions).
    If a specific tool can ascertain by some mechanism the status of the URL
    to resource maps at
    deployment time, the tool can take advantage of this information.
    With the appropriate assertions, the translation phase might be
    performed before deploying
    the JSP page into the JSP container.

    check this link
              http://forums.bea.com/bea/message.jspa?messageID=600012214&tstart=0

  • Jsp related.   user can down load a file from web when ever he clicks link

    hai pls do me favour its very urgent pls
    i have a link in jsp page if user clicks on a link ,,,,,,,,,, he will down load a file (page .....) and save to his worksapce or desktop.......pls help me

    Never mind...
    Message was edited by:
    Martin@Stricent

  • How come the form in the JSP page does not work if user hits "ENTER"

    When I use the following code for loginpage.jsp
    If the user hits ENTER on the keyboard it just displays the same form with nothing in the username box.
    It works if the user clicks the button.
    <HTML>
    <BODY>
    <%
    String submit = request.getParameter("submit");
    if(submit == null){
    %>
    <FORM METHOD=POST ACTION=loginpage.jsp>
    Please enter your username: <INPUT TYPE=TEXT NAME=username SIZE=20>
    <INPUT TYPE=SUBMIT NAME=submit VALUE='Go!'>
    </FORM>
    <%
    else {
    String user = request.getParameter("username");
    if(user == null) {
    // display same page
    } else {
    // foward to next page
    %>
    </BODY>
    </HTML>

    I adjusted my code but it still does nto work when hitting the ENTER keyboard button.
    <HTML>
    <BODY onload="document.form1.left.focus();">
    <%
    String submit = request.getParameter("submit");
    if(submit == null){
    %>
    <FORM METHOD=POST ACTION=loginpage.jsp>
    Please enter your username: <INPUT TYPE=TEXT NAME=username SIZE=20>
    <INPUT TYPE="button" name="left" value="LEFT" onlick="alert(this.name)">
    <INPUT TYPE="button" NAME="right" VALUE="RIGHT" onclick="alert(this.name)">
    </FORM>
    <%
    else {
    String user = request.getParameter("username");
    if(user == null) {
    // display same page
    } else {
    // foward to next page
    %>
    </BODY>
    </HTML>
    If I do this
    <FORM METHOD=POST ACTION=nextpage.jsp>
    And use ENTER keyboard button it works, but not when I have ACTION to teh same page.
    Why is that?
    Is this JSP related or HTML? I thought JSP had something to do with it since it's JSP file.

  • How to gather option values from database in jsp

    jsp experts
    my problem is that i have to populate the optional values that user has to selecet his choice .
    we could have done it by :
    <optional value="item1">item1
    <optional value="item2">item2
    </select>
    but in our database if new category of item is enlisted then what ??? ,thats why we go for populating the values from fetching from database by simple class & populate values in the optional values.
    can any one help about it

    Hi Avina,
    You need to invoke a method from your jsp file which interacts with the database. If you are following the MVC pattern which segregates the View and Contoller part, invoke the controller jsp from your View using the include tag.
    Say this is the View.jsp
    // all your initial page include statements --
    <%
    // all your java code (if necessary)
    %>
    <jsp:include page="Controller.jsp" >
    <jsp:param name="command" value="getOptionList"/>
    </jsp:include>
    <!-- all your html tags -->
    // If you are following my technique, there should be a Controller.jsp which interacts with your database thru some class which you instantiate in this jsp, which invokes some method (that is why i have passed a parameter, so that if u want to make a check you can do so - u may or may not pass the parameters - based on ur requirements).
    Code in Controller.jsp:
    <%
    // MyClass is the class which does the querying into the database.
    // obj.getOptions() is a method in that class which returns a Vector
    // containing all the options from your database.
    // Please ensure that you import the package in this jsp file, so as
    // to get the MyClass.class in this jsp.
    String getWhat = request.getParameter("command");
    if ( getWhat != null && getWhat.equalsIgnoreCase("command") ) {
    MyClass obj = new MyClass();
    java.util.Vector optionsAvailable = obj.getOptions();
    session.setAttribute("Options", optionsAvailable);
    %>
    -------------- End of Controller.jsp related work ---------------
    // Returning back to the code in the View.jsp:
    Once the including is over, the control will return to the next line of code in View.jsp. Just retrieve the data from the session:
    Continued - View.jsp
    <select name="itemsInDB">
    <option value="Select"> Select </option>
    <%
    /* Now you have a vector containing all the options from
    your database. */
    java.util.Vector vecOptions = (java.util.Vector)
    session.getAttribute("Options");
    for (int i=0; i<vecOptions.size(); i++) {
    %>
    <option value="<%=vecOptions.elementAt(i)%>"><%=vecOptions.elementAt(i)%></option>
    <%
    %>
    </select>
    Well thats all thats required. Your problem is solved. You will get a list of all the options in your database. Happy Coding

  • Warning message on JSP page

    Hi all,
    I have 2 JSP Pages, page 1 contains attachment button for (attachment to be uploaded ) and Done button for navigating to second JSP page. Currently Done button is not wait for the attachment to be uploaded .When user clicks on Done Button if attachment is in processing I need to display warning message like "attachment have not been attached. if you continue, attachment will be lost".with OK Cancel buttons.
    Can anyone please suggest
    Thanks in advance.
    Bhavana

    Please post JSP related queries here...
    JavaServer Pages (JSP) and JSTL
    Thanks
    --Anil
    http://oracleanil.blogspot.com

  • Combo box in jsp : implemented by struts tiles

    Hi,
    I have few problems with JSP...
    we have devided the body part in the tiles into two parts
    initially..................
    body1: jsp with combo box
    body2: a blank jsp
    if the user selects an option from the combo box..in onchange function ..iam getting the value of the selected option..and iam doing form.action="action selected by user" ... so that it will go the struts-config then inturn will call the action then by forwarding success..will go to the struts-config file again ..then by have name="seccess".. it will call path="somedefinition"....this definition is defined in the tiles-definition file...
    where again...extending some standard definition by overriding ..
    body1:jsp with combo box
    body2:jsp related to the selected option..in the combo box
    second time.. in body1: again we r calling original jsp na..it will show default select only na??
    so how to get the selected option and how i can give that option as selected when it is loading second time.
    Hope you got my problem...
    Please help me out...
    Waiting for ur kind reply
    Thanks & Regards
    Kranti Kiran Kumar Parisa
    Software Engineer [ e-Biz ]
    [email protected]

    It's not nice to highjack someone elses thread. I posted a reply http://forum.java.sun.com/thread.jsp?forum=45&thread=552915 (though I shouldn't have, shoulda done it here). if you have questions post them to this thread instead. Leave the other one to the OP's question.

  • Unable to add Custom JSP 1.2 Tag Library to Project

    I am trying to upgrade to a newer version of JDeveloper (10.1.3.0.4) but am having a problem with projects that use custom JSP tag libraries.
    After converting the project (.jpr) files to the new version, I double click and go to "JSP Tag Libraries." When I click on "Add" to add a new JSP Tag library, only JSP version 1.1 libraries are shown, I cannot choose any JSP 1.2 tag libraries.
    my TLD files are all JSP 1.2, so I am not quite sure why this isn't working in a newer JDeveloper after it has worked fine in the past. If I examine any JSP page that uses my taglibs, I see the following 2 kinds of error:
    the line:
    <%@ taglib uri="taglib.uri" prefix="mytag" %>
    is underlined in red and says "the tag library taglib.uri is referenced, but not installed"
    And for any lines that try to use the custom tag:
    <mytag:dosomething>
    there is a yellow/orange underline that says "no grammar available for namespace taglib.uri, contents of element dosomething cannot be validated"
    Note that I can add the taglib JAR file under Tools > Manage Libraries, but I cannot add the JSP tag library to my project. Is there some sort of compatibility issue when transferring project files from an old version of JDeveloper?
    Any help would be appreciated

    Yes any new project I create I can specify JSP 1.2 or 2.0 with the wizard and it works fine.
    But I don't want to re-create my entire project file again just to register my taglibs.
    Here's the JSP related section in web.xml:
    <!-- TagLibraries -->
    <taglib>
    <taglib-uri>taglib.uri</taglib-uri>
    <taglib-location>/WEB-INF/tlds/mytag.tld</taglib-location>
    </taglib>
    It's definately something in the project itself... but I am lost as to what it is.
    Edit: nvm I fixed it. It was the web.xml. I had to change the line:
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    into
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    and it worked. Thanks.
    Message was edited by:
    user523020

  • Modifying JSP in OAS installation

    .I am auto generating user id and password field and I need to hide these two field from user creation page.I modified JSP in OAS installation.I followed the following steps for doing
    this.
    1.Unpacked xlWebApp.war.
    2.Modified tiles/util/tjspGenerateCreateUserForm.jsp and packed the war file
    again.
    3.Placed the war file in /webapp folder.
    4.started patch_oc4j.cmd (oc4jadmin password) (database password).
    5.Build was successful.
    6.I checked exploded file in
    E:\oracle\oas\j2ee\home\applications\Xellerate\xlWebApp/tiles/util/tjspGenerateC
    reateUserForm.jsp.
    and I can see my modification there.
    7.I tried to access user creation page but it is still showing my old jsp with no
    modification.
    Please tell me what I am missing.I know for Jboss I need to comment out web.xml but I do not see jsp related section in above exploded web.xml .
    installation.
    Regards
    Nitesh

    Hi
    I am having exactly the same problem here but could not make it work even with cleaning precompiled folder before running the patch.
    What i did :
    1. Unpacked xlWebApp.war.
    2. Modified tiles/tjspViewUserDetailsTiles.jsp and packed the war file
    again.
    3. Placed the war file in /webapp folder.
    4. Stopped OIM services with "opmnctl shutdown"
    5. Placed war file into $APPSERVER/j2ee/home/applications/Xellerate
    6. DELETED EVERYTHING INSIDE "$XELLERATE_HOME/xellerate/webapp/precompiled" FOLDER.
    7. Started OIM services "opmnctl startall"
    8. I can see my modified jsp at $APPSERVER/j2ee/home/applications/Xellerate/xlWebApp/tiles/
    9. I started patch_oc4j.sh. Ended successfully.
    10. Now I can see my modified jsp file in $XELLERATE_HOME/xellerate/webapp/precompiled/jsp-temp/tiles folder also.
    11.I tried to access the page but it is still showing my old jsp with no modification.
    What in the name of god am I doing wrong???

  • JSP Compiler

              Originally I post it to weblogic.developer.interst. But I guess this may be a better space to post the JSP related question. Sorry for the double post
              Hi, there,
              I tried to use the weblogic.jspc to compile my JSP files for debug purpose. However, it doesn't give me detailed information.
              For example, for JSP file test.jsp:
              <%
              out.println(5) // miss ; at the end
              %>
              If I use browser to access it, it will give the error information, like:
              Compilation of ../public_html/jsp_servlet/_test.java' failed:
              /weblogic/appserver/public_html/jsp_servlet/_test.java:74: Invalid type expression.
              probably occurred due to an error in /test.jsp line 2:
              out.println("4")
              /weblogic/appserver/public_html/jsp_servlet/_test.java:76: Invalid declaration.
              (No more information available, probably caused by another error)
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
              But if I use weblogic.jspc to compile it, it only tells you:
              Exec failed .. exiting
              That message is not helpful at all. I tried to use verbose option, it gave me more garbage information, like:
              [jspc] parsing /usr/export/docroot/test.jsp:
              [jspc] parsed test.jsp in 603 ms.
              [jspc] generated java file /usr/export/docroot/test.java, invoking java compiler:
              Exec failed .. exiting
              Then what's the use of that JSP compiler? Is there anyway to get the same error inforamtion on the web page?
              Thanks
              

              This was fixed around service pack 6 in WL 5.1.
              mike
              Rob Woollen <[email protected]> wrote:
              >It looks like it cannot find javac (or whatever java compiler you
              >specified) in the path.
              >
              >-- Rob
              >
              >Lan wrote:
              >>
              >> Originally I post it to weblogic.developer.interst. But I guess this may be a better space to post the JSP related question. Sorry for the double post
              >>
              >> Hi, there,
              >>
              >> I tried to use the weblogic.jspc to compile my JSP files for debug purpose. However, it doesn't give me detailed information.
              >>
              >> For example, for JSP file test.jsp:
              >> <%
              >> out.println(5) // miss ; at the end
              >> %>
              >>
              >> If I use browser to access it, it will give the error information, like:
              >> Compilation of ../public_html/jsp_servlet/_test.java' failed:
              >>
              >> --------------------------------------------------------------------------------
              >>
              >> /weblogic/appserver/public_html/jsp_servlet/_test.java:74: Invalid type expression.
              >> probably occurred due to an error in /test.jsp line 2:
              >> out.println("4")
              >>
              >> /weblogic/appserver/public_html/jsp_servlet/_test.java:76: Invalid declaration.
              >> (No more information available, probably caused by another error)
              >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
              >>
              >> But if I use weblogic.jspc to compile it, it only tells you:
              >>
              >> Exec failed .. exiting
              >>
              >> That message is not helpful at all. I tried to use verbose option, it gave me more garbage information, like:
              >>
              >> [jspc] parsing /usr/export/docroot/test.jsp:
              >> [jspc] parsed test.jsp in 603 ms.
              >> [jspc] generated java file /usr/export/docroot/test.java, invoking java compiler:
              >> Exec failed .. exiting
              >>
              >> Then what's the use of that JSP compiler? Is there anyway to get the same error inforamtion on the web page?
              >>
              >> Thanks
              

  • How to refresh frame1.jsp from frame2.jsp?

    Hi,
    I have main.jsp that holds frameset that contains "frame1.jsp" and "frame3.jsp".
    on submit at "frame3.jsp" it goes to "frame2.jsp", now I want to refresh "frame1.jsp"
    p.s.
    I don't mind to refresh the "main.jsp", I guess that will refresh the frames inside him too - include "frame1.jsp".
    BUT, how can I do it?

    Hi,
    this seems to be a HTML/JavaScript problem, not JSP related.
    The file frame2.jsp could refresh frame1.jsp using "onLoad" on the <body> tag.
    You could also do this before loading frame2.jsp, while pressing the submit button. Instead of using a submit buton you could use a JavaScript function that would submit the form and reload another frame.
    Good Luck!
    PS: If this isn't enough help, plese post the contents of main.jsp (the frameset) so you can get some real code back.

  • Tomcat 4.0.x and JSP / JSTL performance problems.

    Hello everyone,
    I've got a web application where some of my JSP pages are rendering quite slowly. As an example I'll use a JSP page that I wrote for browsing through a user database. It uses two beans...
    1. jobBean - Ensures that all of the required (and correct) beans that will be used for processing the request have been loaded.
    2. browserBean - A basic JavaBean that holds a set of UserBean(s) and other information pertinent to database queries (start, limit, order).
    I'm using Apache Struts to map requests to the appropriate processing modules. Now the problem I'm having is that each request is taking between 1 and 2 seconds to execute. As you can imagine that's not going to allow for very many simaltaneous users. I've tracked the problem down to something JSP related. All of my code executes fairly quickly (I think). It takes about 20-30ms for my code to identify the request, load the requested data from the database, and convert it into a usable format (the browserBean). Here's my code...
    <%@ page contentType="text/html"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <META http-equiv="Cache-Control" content="no-cache">
    <title>
    Browse Users
    </title>
    </head>
    <body>
    <!-- Set up the OrganizationBeans for use -->
    <jsp:useBean id="jobBean" class="com.vacode.jobs.generic.JobBean" scope="session" />
    <jsp:useBean id="browserBean" class="com.vacode.mqdb.beansets.user.UserBrowserBean" scope="session" />
    <!---------------------------->
    <!-- Start Time Logged Here -->
    <!---------------------------->
    <c:if test="${jobBean.currentJob.name != 'BrowseUserJob'}">
         <!-- This page was accessed before everything was properly initialized -->
         <c:url var="browseUser" value="manageUsers.do">
              <c:param name="action" value="browse" />
         </c:url>
         <c:redirect url="${browseUser}" />
    </c:if>
    <form action="manageUsers.do" method="get">
         <input type="hidden" name="action" value="browse">
         <input type="hidden" name="start" value="<c:out value="${browserBean.dummyStart}" />">
         <input type="hidden" name="order" value="<c:out value="${browserBean.order}" />">
         I would like to view
         <select name="limit">
              <c:forEach begin="1" end="5" var="current">
                   <option value="<c:out value="${current*5}" />"
                        <c:if test="${browserBean.dummyLimit == current*5}">
                        selected
                        </c:if>
                   >
                    <c:out value="${current*5}" />
                   </option>
              </c:forEach>
         </select>
         results per page.
         <input type="submit" action="submit">
    </form>
    <c:url var="id" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_ID" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="name" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="firstName" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_FIRST_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="lastName" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_LAST_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="email" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_EMAIL_ADDRESS" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="organization" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_ORGANIZATION_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="status" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_STATUS_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="role" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="ROLE_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <table>
         <tr>
              <td><a href="<c:out value="${id}" />">Id</a></td>
              <td><a href="<c:out value="${name}" />">User Name</a></td>
              <td><a href="<c:out value="${firstName}" />">First Name</a></td>
              <td><a href="<c:out value="${lastName}" />">Last Name</a></td>
              <td><a href="<c:out value="${email}" />">E-Mail</a></td>
              <td><a href="<c:out value="${organization}" />">Organization</a></td>
              <td><a href="<c:out value="${status}" />">Status</a></td>
              <td><a href="<c:out value="${role}" />">User Type</a></td>
         </tr>
    <c:forEach items="${browserBean.beans}" var="bean">
         <tr>
              <c:url var="manage" value="manageUsers.do">
                   <c:param name="action" value="modify" />
                   <c:param name="beanId" value="${bean.userId}" />
              </c:url>
              <td><a href="<c:out value="${manage}" />"><c:out value="${bean.userId}" /></a></td>
              <td><c:out value="${bean.userName}" /></td>
              <td><c:out value="${bean.firstName}" /></td>
              <td><c:out value="${bean.firstName}" /></td>
              <td><c:out value="${bean.email}" /></td>
              <td><c:out value="${bean.organizationName}" /></td>
              <td><c:out value="${bean.statusName}" /></td>
              <td><c:out value="${bean.roleName}" /></td>
         </tr>
    </c:forEach>
    <!-------------------------->
    <!-- End Time Logged Here -->
    <!-------------------------->
    </table>
    <c:url var="next" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="${browserBean.nextPageStart}" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
         <c:param name="order" value="${browserBean.order}" />
    </c:url>
    <c:url var="previous" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="${browserBean.previousPageStart}" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
         <c:param name="order" value="${browserBean.order}" />
    </c:url>
    <c:if test="${browserBean.previousPageStart>-1}">
         <a href="<c:out value="${previous}" escapeXml="false" />">previous</a>
    </c:if>
    <c:if test="${browserBean.nextPageStart>-1}">
         <a href="<c:out value="${next}" escapeXml="false" />">next</a>
    </c:if>
    <br>
    <br>
    Quick Jump To Page:
    <c:forEach varStatus="loopTag" items="${browserBean.pageStartValues}" var="current">
    <c:choose>
         <c:when test="${loopTag.index+1==browserBean.currentPageNumber}">
              <c:out value="${loopTag.index+1}" />
         </c:when>
         <c:otherwise>
         <c:url var="thisPage" value="manageUsers.do">
              <c:param name="action" value="browse" />
              <c:param name="start" value="${current}" />
              <c:param name="limit" value="${browserBean.dummyLimit}" />
              <c:param name="order" value="${browserBean.order}" />
         </c:url>
         <a href="<c:out value="${thisPage}" />"><c:out value="${loopTag.index+1}" /></a>
         </c:otherwise>
    </c:choose>
    </c:forEach>
    <br>
    <br>
    Max Possible Pages: <c:out value="${browserBean.maxNumberOfPages}" />
    <br>
    Current Page: <c:out value="${browserBean.currentPageNumber}" />
    </body>
    </html>I've added comments where I timed my code from (by writing new Date().getTime() to the console). It usually takes between 1 and 2 seconds for that block of JSP to execute. I wrote a test class that should be very similar to the process (iterating over the forEach loop mainly) and it usually executed in 10ms to 20ms.
    I had a look at the servlets that were generated by Tomcat and I noticed that for each <c:url> I used there's about 300 lines of code (with several syncronized() methods). Could this have anything to do with it? If so, what could I do to improve the performance?
    Worth mentioning... The machine I am using is an AMD Athlon 1GHZ with 768MB RAM, 7200 RPM UDMA100 IDE HDD.
    I'm also using Tomcat integrated with a development environment (IntelliJ IDEA).
    Any help that anyone could offer is much appreciated.
    Thanks,
    Ryan

    Can you get acceptable performance if you hack out everything except the browserBean forEach loop? Maybe you are trying to do too much runtime EL evaluation on the page.
    If performance improves, you may want to push the URL construction and startValue computations to a Struts Action and put a bunch of objects on the requestScope (like "id_url", "name_url", "pageStartValue").
    Putting these computations in the Action would avoid having JSTL parse each of the ${} arguments, evaluating the expressions, and using costly reflection to turn ${browserBean.order} into browserBean.getOrder().

  • JSPs are always being regenerated

    I have just migrated my application from
              WL 5.1 to 7.0.2. I am using exploded format
              and the application is the "DefaultWebApp"
              I have set the pageCheckSeconds in the
              weblogic.xml to be -1. However the JSP is
              always recompiled. I set it to a positive
              number too and it is always recompiled (after the server restart).
              Any ideas?
              Thanks!
              -Lori
              

              Well I tried putting them under the <app home>/Web-inf/classes
              directory and it still regenerates them. I am using exploded
              format right now and would like it to work with this.
              Any other ideas before I contact support?
              Thanks!
              -Lori
              "Xiang Rao" <[email protected]> wrote:
              >
              >From my personal experience with WL7.0, I believe you also set JSP precompile
              >flag.
              >My experience with this flag is not good either. Every time I started
              >the server
              >or redploy my WAR files, I found WL7 will do what you have experienced
              >and it
              >is very painful for me to deploy web applications with hundreds of JSP
              >in the
              >cluster environment, and I have to disable such flag.
              >
              >From the petstore example, I found that all JSPs are precompiled to /WEB-INF/classes/jsp_servlet
              >directory. (Surprisingly, in its weblogic.xml, there is no single JSP
              >related
              >flag.) Perhaps that is the way.
              >
              >Weblogic document site does not provide step by step details to deploy
              >JSP in
              >precompiled form. The only thing I can find is that it suggestes to precompile
              >JSPs to /WEB-INF/classes in a WAR file.
              >
              >From Weblogic doc:
              >You can configure WebLogic Server to precompile your JSPs when a Web
              >Application
              >is deployed or re-deployed or when WebLogic Server starts up by setting
              >the precompile
              >parameter to true in the <jsp-descriptor> element of the weblogic.xml
              >deployment
              >descriptor. To avoid recompiling your JSPs each time the server restarts
              >and when
              >you target additional servers, precompile them using weblogic.jspc and
              >place them
              >in the WEB-INF/classes folder and archive them in a .war file.
              >
              >
              >
              >"Lori Ronning" <[email protected]> wrote:
              >>
              >>I have that set. And it is set to the directory to where
              >>they were already pre-compiled. So everytime they are generated
              >>they overwrite the pre-compiled ones.
              >>
              >>"Xiang Rao" <[email protected]> wrote:
              >>>
              >>>I think you need set working directory for your JSP.
              >>>
              >>>
              >>>Lori Ronning <[email protected]> wrote:
              >>>>I have just migrated my application from
              >>>>WL 5.1 to 7.0.2. I am using exploded format
              >>>>and the application is the "DefaultWebApp"
              >>>>I have set the pageCheckSeconds in the
              >>>>weblogic.xml to be -1. However the JSP is
              >>>>always recompiled. I set it to a positive
              >>>>number too and it is always recompiled (after the server restart).
              >>
              >>>
              >>>>Any ideas?
              >>>>Thanks!
              >>>>-Lori
              >>>
              >>
              >
              

  • Problem in compiling servlets

    Hi
    I have j2sdk1.4.0 and i am using J2ee application server.My problem is while compiling i get error as "javax.servlet" package not found.Can anybody suggest me how to give the classpath for successful compilation.
    regrds
    Vaijayanthi

    hi vaiju
    basically it gets struck while finding as well loading the appropriate library files when there is a request for servlet.. tats where it gave the error of javax.servlet is missing..
    all servlet and jsp related files (class files) reside in this javax.servlet package.. its there javax.servlet jar or simply servlet.jar or even you can use the j2ee.jar which the superset of all of these..
    you can any one of the following 2 things:
    (1) you can either set the classpath of your pc to point to or include the location where it contains any of these .jar files
    (2) you can put the reqd lib files in the container's (web/app server's) location which it internally maintains for searching while loading/running the applications...
    here you have two options
    (a) either you can include the jar files with the individual applications (your applications WEB-INF/lib folder, which you can find inside the <TOMCAT_HOME>/webapps/ YOUR_APP_ROOT/WEB-INF/lib folder)
    (b) you can put the jar files in the common place of the container in case of being required by several applications (in case of tomcat, you can put in <TOMCAT_HOME>/common/lib folder).
    Dont forget to mention this in the build.xml file in case if you use ANT tool to build your application. you can set the <property> for the classpath.
    Hope this helps...
    Good luck to your journey in Servlets....

Maybe you are looking for