Does out.flush() work in a JSP page without buffering?

          All:
          I am using WLS 4.51 and have found that it is not possible to flush the contents
          of the ServletOutputStream. I have seen this behavior in JSPs and Servlets.
          What I am trying to achieve is a simple status message that is displayed on the
          client for a long running transaction.
          TIA
          Brian
          

Hi.
You can use JSTL perfectly in ADF. I don't share the opinion of Oracle not recommends... there are a lot of official pages saying how to use JSTL in ADF.
<af:outputText value="#{fn:length(yourList)}"/>Yannick is saying that you can't mix lifecycles. Take care using $ or # operators :).
For example if you are using a JSTL c:forEach. Next code is going to crash:
<c:forEach var="..." value="${list}">
   <af:outputText value="#{list.item}"/>
</c:forEach>Because # is evaluated in prepareModel phase and $ while rendering.
I hope this help you.

Similar Messages

  • Forward to JSP page without using Navigation Model

    How can I forward to a JSP page without using the Navigation Model?

    It's done in the cardemo example in
    ImageMapEventHandler.processAction() Is there a reason
    for it there?Ah ... that makes sense.
    That code in CarDemo was written before there was such a thing as a NavigationHandler, and we didn't have time to update it to the new approach before the EA4 release. That'll be changed before the next one. In the mean time, I'd recommend that you use the navigation rules mechanism where it works for you, because it encourages good separation of business logic and presentation logic that will lead to more maintainable applications.
    Craig

  • Error, package does not exist, thrown when calling jsp page

    Hi
    I have downloaded sample jsp pages for interaction with Crystal reports. When I compile these jsp pages in NetBeans 3.6 there are no problems. When I deploy these pages and associated libraries to Tomcat 5, I get the following error when attempting to call the jsp page, but all the jars used in NetBeans are present in the web-inf/lib directory and I have looked in the jars and found classes in the com.crystaldecisions.report.web.viewer package. I have been unable to find any information after googling and looking at the jakarta bug database. What am I doing wrong?
    The error...
    2004-09-22 17:40:30 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 1 in the jsp file: /CrystalReportsInteractiveViewer.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    E:\Tomcat5\work\Catalina\localhost\crystal\org\apache\jsp\SimplePreviewReport_jsp.java:9: package com.crystaldecisions.report.web.viewer does not exist
    import com.crystaldecisions.report.web.viewer.*;
    ^
    E:\Tomcat5\work\Catalina\localhost\crystal\org\apache\jsp\SimplePreviewReport_jsp.java:180: cannot resolve symbol
    symbol : class CrystalReportInteractiveViewer
    location: class org.apache.jsp.SimplePreviewReport_jsp
    CrystalReportInteractiveViewer viewer = new CrystalReportInteractiveViewer();
    ^
    An error occurred at line: 1 in the jsp file: /CrystalReportsInteractiveViewer.jsp
    Generated servlet error:
    E:\Tomcat5\work\Catalina\localhost\crystal\org\apache\jsp\SimplePreviewReport_jsp.java:180: cannot resolve symbol
    symbol : class CrystalReportInteractiveViewer
    location: class org.apache.jsp.SimplePreviewReport_jsp
    CrystalReportInteractiveViewer viewer = new CrystalReportInteractiveViewer();
    ^
    An error occurred at line: 1 in the jsp file: /CrystalReportsInteractiveViewer.jsp
    Generated servlet error:
    Note: E:\Tomcat5\work\Catalina\localhost\crystal\org\apache\jsp\SimplePreviewReport_jsp.java uses or overrides a deprecated API.
    Note: Recompile with -deprecation for details.
    3 errors
         at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
         at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
         at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:696)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
         at java.lang.Thread.run(Thread.java:534)
    The offending page is ....
    <%
    /*==========================================================================
    INSTANTIATE THE VIEWER AND DISPLAY THE REPORT THROUGH THE INTERACTIVE VIEWER
    ============================================================================
        - Create a Viewer object
        - Set the source for the  viewer to the client documents report source
        - Process the http request to view the report
        - Dispose of the viewer object
    // Create an Interactive Viewer
    CrystalReportInteractiveViewer viewer = new CrystalReportInteractiveViewer();
    // Set the name for the interactive viewer
    viewer.setName("Crystal_Report_Interactive_Viewer");
    // Set the source for the interacive viewer to the client documents report source
    viewer.setReportSource(clientDoc.getReportSource());
    // Process the http request to view the report
    viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
    // Dispose of the viewer object
    viewer.dispose();
    %>included in...
    <%@ page import="com.crystaldecisions.sdk.occa.report.application.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.*"%>
    <%@ page import="com.crystaldecisions.report.web.viewer.*"%>
    <html>
    <head>
    <title>Begin Here - Simple Preview Report</title>
    </head>
    <body>
    <%
    /*=================================================================
    WORKING WITH THE REPORT APPLICATION SERVER AND JSP TO VIEW REPORTS
    ===================================================================
    Authors Name: Ken Andony
    Technology supported by the app: Report Application Server
      ALWAYS REQUIRED STEPS
       - Create a new Report Application Session
       - Create a Report Application Server (RAS) Service
       - Set the RAS Server to be used for the service
       - Initialize the RAS Service
       - Create the report client document object
       - Set the RAS Server to be used for the report client document
       - Open the report, and set the open type to Read Only
      INSTANTIATE THE REPORT VIEWER
       - Create a Viewer object
       - Set the source for the viewer to the client documents report source
       - Process the http request to view the report
       - Dispose of the viewer object
    ==================================================================*/
    * This line creates a string variable called reportname that we will use to pass
    * the Crystal Report filename (.rpt file) to the OpenReport method contained in
    * the AlwaysRequiredSteps.jsp.
    String reportName ="SimplePreviewReport.rpt";
    %>
    <%
    /* ALWAYS REQUIRED STEPS
      Include the file AlwaysRequiredSteps.jsp which contains the code
      for steps:
       - Create a new Report Application Session
       - Create a Report Application Server (RAS) Service
       - Set the RAS Server to be used for the service
       - Initialize the RAS Service
       - Create the report client document object
       - Set the RAS Server to be used for the report client document
       - Open the report, and set the open type to Read Only */
    %>
    <%@ include file="AlwaysRequiredSteps.jsp"%>
    <%
    /* INSTANTIATE THE REPORT VIEWER
      There are three Report Viewers:
      1.  Crystal Reports Interactive Viewer
      2.  Crystal Reports Viewer
      3.  Crystal Reports Parts Viewer
      The choices are CrystalReportsInteractiveViewer.jsp, CrystalReportsViewer.jsp,
      CrystalReportsPartsViewer.jsp
      Note that to use this include you must have the appropriate .jsp file in the
      same virtual directory as the main jsp page.
      =============================================================================
        DISPLAY THE REPORT
        - display the report using one of the Thin Client DHTML viewers
       Include one of the DHTML Viewers.
        - Crystal Reports Interactive Viewer          =   CrystalReportsInteractiveViewer.jsp
        - Crystal Reports Viewer                                        =   CrystalReportsViewer.jsp
        - Crystal Reports Parts Viewer                         =   CrystalReportsPartsViewer.jsp
        Note** - To use the report parts viewer successfully you are required to
        choose and name three objects in the report to Node0, Node1 and Node2.
        You can access an objects name by using the Format Editor dialog box.
        For more information on the Format Editor Dialog Box and setting objects
        names, please refer to the Help Contents (Help Menu->Crystal Reports Help)
        or by pressing F1
      =============================================================================*/
    %>
    <%@ include file="CrystalReportsInteractiveViewer.jsp" %>
    </body>
    </html>

    Thanks Tien-Chih Wang. It worked...well I'm getting a new set of errors, but progress has been made!
    I understand that if placed in the common directory the jar will be available to all webapps but why does it make a difference whether a jar file is placed under the $TOMAT_HOME/common/lib or $TOMAT_HOME/webapps/appname/web-inf/lib directory if I only need to access the jar from one webapp?

  • How does session bean contain in the JSP page

    May i know how session bean contains in the JSP page
    If the situation is like the following ...
    if i dont want to put the session bean in the session
    like this :
    session.setAttribute("UserBean",userBean);
    the way i get the session bean is only
    session.getAttribute("UserBean");
    Does have the other way to get the Session bean during the JSP
    if i dont want to use this kind of way,
    what else i can do for?
    may i know the solution with detailed
    and please attach the solution of code to me if you know...
    thanks...

    Hi,
    I am not clear with ur query..
    What I understood from ur query is that, u are trying to put the session ejb in the HttpSession Object for some use ahead in future?
    If this is the case, then I think are approach is not correct.
    StatefulSession beans are meant for this purpose, i.e they will be maintaining the client session. So use the same using the JndiLookup of the HomeInterface and the getting the Home reference and calling the businessmethods
    sameer

  • What does out.flush(); do?

    I can't find it in the API.

    what does toilet.flush(); do? same thingTo extend the analogy, is
    [url=http://java.sun.com/j2se/1.4.2/docs/api/java/io/Pr
    >
    ntWriter.html#PrintWriter(java.io.Writer,%20boolean)]Pr
    ntWriter's autoFlush like those smart toiletsthat sense when to flush?And are there any output streams or writers that have
    to be flushed twice like our toilet here at work?
    Well, fortunately, Java (and the TCP/IP stack) hide the plumbing from you, so no. Internally, there could be a reflush (packet loss resend).

  • Can we call a javascript fun through jsp page without any event

    Hi ,
    I am new to jsp,javascript and i have a little question.
    If i make a function in a js file and want to call it from a jsp file without any event ,ie can i write some thing like <%abc()%> in ths jsp page ,which call the function from another .js file.
    I suppose that it can be done as gmail page reloads it self after some time and for http mostly we use pull ie request from the client side ,so i think that they must be doing something like timer expiry and reload themselves.
    please help me with the solution.
    Thanks & Regards
    Saurabh

    sorta....
    The JS runs in the client, not on the server, so you would just be writing JS code as HTML... If your page is like this and the myscript.js file defines 2 functions (function1, function2), you can call them on page load in either of these ways. I'm not sure offhand which would get called first, but the scripts called inline in the page would be called in the order they are defined in the page. But that is all HTML, it has nothing to do with JSP.
    <head>
    <script language="JavaScript" type="text/javascript" src="myscript.js" />
    </head>
    <body onload="function1();">
    <script language="JavaScript" type="text/javascript">
    function2();
    </script>
    </body>

  • Does JSTL functions work in custom Spaces Page Style ?

    I am trying to create a custom page style and have to write some logic where I have to use fn:containsIgnoreCase. When I create pages that use this Page Style, it throws a white page and doesnt work.
    I have also added the below in the root
    xmlns:fn="http://java.sun.com/jsp/jstl/functions"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    When I remove the fn:containsIgnorecase, It works fine.
    My version of Webcenter Spaces is 11.1.1.6
    Edited by: Rohith puchalapalli on Apr 9, 2013 3:39 PM

    Hi.
    You can use JSTL perfectly in ADF. I don't share the opinion of Oracle not recommends... there are a lot of official pages saying how to use JSTL in ADF.
    <af:outputText value="#{fn:length(yourList)}"/>Yannick is saying that you can't mix lifecycles. Take care using $ or # operators :).
    For example if you are using a JSTL c:forEach. Next code is going to crash:
    <c:forEach var="..." value="${list}">
       <af:outputText value="#{list.item}"/>
    </c:forEach>Because # is evaluated in prepareModel phase and $ while rendering.
    I hope this help you.

  • Does BB GPS work on T-Mobile Pearl without a data plan?

    I do not have a data plan with my BB.
    The GPS entry under Advanced Options shows: GPS Data Source: None, BPS Services: Location ON.
    I'd like to use the GPSLogger application that says it needs no data access to operate, but it sits on "Waiting for GPS data...". 
    What exactly is the "GPS Data Source" mentioned in the options?
    Thanks in advance.

    okay, I was tricked by the following page :
    http://www.blackberry.com/blackberrypearl/8200/pearl_specifications.shtml
    tha indicates that the application "BlackBerry Maps" is included on the 8220. Apparently, RIM believes it is interesting to have that application without an internal GPS receiver included.
    Sorry for the false hope.
    here is a comparison of Storm, 8110, 8220 and 8230. All have a GPS receiver included except the 8220.
    http://na.blackberry.com/eng/devices/compare/product-attr-compare.jsp?products=1497&products=1501&pr...
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • Weblogic 6.0 doesn't update my JSP-pages without a restart!!?!

     

    I had the same problem with Weblogic 6.0sp1 Windows
    Here's what I did:
    1) Shutdown Weblogic
    2) Delete the temporary folder and files under:
    C:\bea\wlserver6.0sp1\config\mydomain\applications\.wl_temp_do_not_delete
    3) Keep only 2 web applications under the applications directory:
    C:\bea\wlserver6.0sp1\config\mydomain\applications\
    DefaultWebApp_myserver
    and myApplication
    4) Restart Weblogic
    Now the updates to the Jsps of myApplication are refreshed without restarting Weblogic !

  • JDK 1.6_07 with Windows: System.out.flush() does not work...

    I wonder if this is a known issue: Since I upgrade the jdk1.6 version to the _07 pack, text IO does not work anymore with WinXP cmd.exe window. Assuming a static import of System.out, I use:
    static void prompt()
      out.print(pr); //pr is a prompt string...
      out.flush();
    }works as usual with Unix/Linux, but with windows nothing will be written to the terminal, until I make at least one input. In that case a barrage of cached prompts appear all at once.
    Do we have a bug for it, can we work around somehow?
    Thomas

    Since this code works correctly in Java 6u10 on Windows XP
    System.out.print("This is the data");
    System.out.flush();You are apparently doing something unusual or wrong. What is "out"?
    Show a small sample program that compiles and exhibits the problem when executed.

  • How the hell does a person share session data between JSP page and a Servle

    1. How the hell does one share session data between a servlet and a JSP page without using a bean but rather using a normal string variable.
    2. When using session scope to access a bean the application complains about not finding the bean on the specified scope, however when I use an application scope the save the same bean, the application does find it.
    Please help!!!!!!!
    SERVLET:
    HttpSession session = request.getSession(true);
    ServletContext servletContext = session.getServletContext();
    customerID = result.getString("CustomerID");
    userName = result.getString("UserName");
    session.setAttribute("UserName",userName);
    session.setAttribute("CustomerID",customerID);
    System.out.println("Customer UserName = " + session.getAttribute("UserName"));
    response.sendRedirect("/economics/subscriptions/default.jsp");
    JSP PAGE:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root xmlns:jsp=http://java.sun.com/JSP/Page mlns:c="http://java.sun.com/jsp/jstl/core" xmlns:sql="http://java.sun.com/jsp/jstl/sql" version="2.0">
    <jsp:directive.page isThreadSafe="true" session="true" contentType="text/xml"/><jsp:output omit-xml-declaration="false"/><jsp:scriptlet>response.addHeader("x-xslt-nocache", "true");</jsp:scriptlet><pml>
    <page type="web" search="y">
         <pageName>Commercial Banking</pageName>
         <jsp:directive.include file="/economics/header.inc"/>
         <jsp:directive.include file="/login.inc"/>
         <jsp:directive.include file="/economics/leftMenu.inc"/>
         <!--<jsp:useBean id="UserName" type="java.lang.String" scope="session" />-->
         <content>
         <searchSum>Commercial - Main Content</searchSum>
         Value = <c:out value="${request.session.getAttribute("UserName")}"/>
         </content>
         <jsp:directive.include file="/economics/rightNav.inc"/>
         <jsp:directive.include file="/footer.inc"/>
    </page></pml></jsp:root>

    For a start, just "session" instead of "request.session" would work better. But why did you post this here and not in the JSP forum? Doesn't seem to have anything to do with Java programming.

  • My jsp page does not get refreshed

    I have a jsp page which looks like -
    the top portion of the page has 3 textboxes and a submit button to add an entity.
    the rest of the page displays a list of all the entities in the system.
    when i load the jsp and add a new entity, the new entity shows up on the list. when i try to add a new entity second time, the entity does get added into the database, but does not show up in the list.
    In the action class, i make a request to the dao and print all the values from the list, returned by the dao. Since the newly added values are present in the list, returned by the dao, i dont think there is anything wrong with my business layer or the DAO layer.i dont understand, why it does not show up in the jsp page.
    any ideas. i am wondering if the data is being cached, so, in the jsp page i have also set the following parameters:
      <head><meta http-equiv="Expires" CONTENT="0"><meta http-equiv="Cache-Control" CONTENT="no-cache"><meta http-equiv="Pragma" CONTENT="no-cache">
    --------------------------------------------------------------------------------Has this to do anything with Struts and Hibernate which i use in my application? The same thing happens, when i edit. when i click on edit button, it takes the user to a different page, i edit the details and click on save button. the control returns back to the list page, but the changes are not shown, although the changes are saved to the db. how do i prevent cache. i am putting my entire list in a request object, before doing an action forward to the jsp page

    Hi,
    instead of using the cache in the meta tag try with the following lines,
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("Expires", 0); Regards,
    Bala A

  • Are not interpreted JSTL tags in a JSP page including in a servlet.

    Hi people,
    I have a project where una page (index.jsp) includes a servlet (MyServlet), that consult a persistence class and get a List of objects (Users),      
    then the servlet passes the List to a Request object and includes another JSP page (showUsers.jsp). And this is conceptually correct, but don´t works, the JSTL tags are not interpreted in showUsers.jsp.
    This is my code...
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <c:out value="Show me some things index.jsp"/>
    <div style="border-color:red; border:solid; padding-left:60px">
          <jsp:include flush="true" page="pepe/MyServlet"/>
    </div>
    </body>
    </html>...and the Servlet...
    public class MyServlet extends HttpServlet
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
              UserManager um = new UserManager();
              List users = um.getUsers(); //This use Hibernate to return a Users List
              request.setAttribute("users", (ArrayList) um.getUsers());
              request.getRequestDispatcher("/showUsers.jsp").forward(request, response);
    }...Finally, we have the showUsers.jsp file....
    <c:out value="Show me some thing showUsers.jsp"/>
    <table>
         <tr>
              <th>ID</th>
              <th>Name</th>
              <th>e-Mail</th>
              <th>Type</th>
         </tr>
         <tr>
              <c:foreach items="${requestScope.users}" var="user">
                   <td><c:out value="${user.id}" /></td>
                   <td><c:out value="${user.name}" /></td>
                   <td><c:out value="${user.email}" /></td>
                   <td><c:out value="${user.type}" /></td>
              </c:foreach>
         </tr>
    </table>This i get as result page...
    ID       Name       e-Mail       TypeFinally, this is the code of showUsers.jsp...
    <c:out value="Show me some thing showUsers.jsp"/>
    <table>
         <tr>
              <th>ID</th>
              <th>Name</th>
              <th>e-Mail</th>
              <th>Type</th>
         </tr>
         <tr>
              <c:foreach items="[src.User@18f729c, src.User@ad97f5, src.User@d38976, src.User@1e5c339, src.User@17414c8, src.User@7a17]" var="user">
                   <td><c:out value="" /></td>
                   <td><c:out value="" /></td>
                   <td><c:out value="" /></td>
                   <td><c:out value="" /></td>
              </c:foreach>
         </tr>
    </table>Somebody can help me?
    Many thanks,
    Gonzalo

    Thanks you all guys,
    I appreciate very much your help. In response to everyone ...
    BalusC wrote:
    Is JSTL taglib declared in top of that JSP page? I don't see it back in the posted code snippet. In this example I stuck...
    request.getRequestDispatcher("/showUsers.jsp").forward(request, response);By mistake, but this is just a test, the original line of my servlet is...
    request.getRequestDispatcher("/showUsers.jsp").include(request, response);As you can see, both (the servlet and the showUser.jsp file) are included in the index.jsp file. So the header...
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>...in the index.jsp file should works (I hope so).
    njb7ty wrote:
    I assume in your web.xml, you have ''pepe/MyServlet' defined as a servlet tag and servlet map tag? Without that, I don't think your JSP will find the servlet. I'm >not sure you need it in web.xml since I never call a servlet from a JSP page.
    I suggest putting System.out.println() throughout your servlet code and out.println() in your JSP pages to see exactly what is called and when.
    As a general rule, JSP files are to display data only, and submit back to a servlet. The servlet does all the business logic and dispatches to the appropriate >JSP page. The JSP shouldn't have any business logic. Including the servlet looks kinda like including business logic. Actually, in a MVC design, your >presentation, control, busines, and database layers have their own isolated responsibilities.
    I suggest the servlet put data as one java bean in request scope via request.setAttribute() and dispatch to the JSP page. The JSP page gets the data via ><useBean> tag. The JSTL gets the variables from the useBean tag and uses the data from there to display it. Really, this is my web.xml file...
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">
         <servlet>
              <servlet-name>MyServlet</servlet-name>
              <servlet-class>src.MyServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>MyServlet</servlet-name>
              <url-pattern>/pepe/MyServlet/*</url-pattern>
         </servlet-mapping>
    </web-app>Regarding putting System.out.println() and out.println(), i did it and thats works.
    Respect of your last comment, I am not a expert in MVC, but I understand that the view layer can make calls to the Controller layer, I am wrong?
    evnafets wrote:
    It's not. However thats not code, but the generated HTML.
    As Balusc pointed out it's the result of running this JSP page without importing the tag library at the top.
    Because the tag library is not declared, it treats the <c:forEach> and other tags as template text, and basically ignores them.
    It then evaluates the ${items} attribute as an expression in template text, calling toString() on it.
    Cheers,
    evnafets      The file showUsers.jsp are included into the index.jsp page, that's have the header taglib. Could this works?
    BalusC wrote:
    njb7ty wrote:
    By the way, I dont think this is the correct format for the foreach tag:
    <c:foreach items="[src.User@18f729c, src.User@ad97f5, src.User@d38976, src.User@1e5c339, src.User@17414c8, src.User@7a17]" var="user">You're right friend.
    And that's my problem. Any ideas?
    Thanks everyone,
    Gonzalo

  • How to include a .class file in a jsp page

    hi everyone,
    i know the syntax as:
    <%@ include file = "filename.class" %>
    then at run time the server could not find the class file
    if i use,
    <%@ page import = "FileName.class" %>
    then also the same problem persists
    & if i use
    <jsp:include page = "Relative address"/>
    the problem still remains as it is...
    please help me out...i am working on developing an EJB application in which client interacts with server's Stateful session bean through a jsp page...it is necessary for me to include the home interface class file in my jsp page.
    P.S. do not suggest me to include the class file in a package & then use
    <%@ page import = "packageName.ClassFileName" %>
    i
    Edited by: Ankit_JIITU on 6 Jul, 2008 1:55 AM

    Ankit_JIITU wrote:
    i have already included the remote interface class file by <%@ page import = "University.RemoteInterfaceName" %>in my jsp page ...
    if i try to make a new package called test & then include my home interface in that package...i need to import University.*to generate the class file of my home interface ; but the class file generation is not taking place as i am getting the error..
    "package University does not exist".How can i overcome this problem. The package University, which you are trying to import, must be in the classpath. If you removed it then you will have to add it back.
    i have tried my best..but tell me if there's any possible way of including a class file in the jsp page without involving a package.No, there isn't.
    If not,then pls help me to generate the class file of my home interface within a package called test.Read the New To Java Tutorial and understand how packages work.
    >
    i am assuming that u have a deep knowledge of developing EJB applications.

  • Weblogic 10.3 SocketException at out.flush

    I have a server/jsp where I am doing out.flush().
    This throws following exception:
    java.net.SocketException: Connection reset by peer: socket write error
         at java.net.SocketOutputStream.socketWrite0(Native Method)
         at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
         at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
         at weblogic.servlet.internal.ChunkOutput.writeChunkNoTransfer(ChunkOutput.java:548)
         at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:505)
         at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
         at weblogic.servlet.internal.CharsetChunkOutput.flush(CharsetChunkOutput.java:249)
         at weblogic.servlet.internal.ChunkOutputWrapper.flush(ChunkOutputWrapper.java:171)
         at weblogic.servlet.jsp.JspWriterImpl.flush(JspWriterImpl.java:98)
         at jsp_servlet._xxx.__yyy._jspService(__yyy.java:146)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    1. the problem is always reproducible.
    2. Not seen on other App Server.
    3. Not Seen on Mozilla. Have seen the problem with IE only.
    There are no user actions to stop/cancel the operation.
    Most of the times, the page is rendered correctly but we see this error in log.
    I have seen several posts where people have experienced this problem but no solution for it.

    The time-out you are getting is that related to a transaction?
    You can set the transaction time-out in the WebLogic console go to the JTA page for the domain, and change the value in the Timeout Seconds field.
    When you are using EJBs, you can also set the time-out on a EJB basis, instead of configuring the time-out for the whole domain.
    For example, in weblogic-ejb-jar.xml, you can configure the time-out by using:
    <weblogic-ejb-jar ...>
        <weblogic-enterprise-bean>
            <ejb-name>YOUR_EJB_NAME</ejb-name>
            <enable-call-by-reference>True</enable-call-by-reference>
            <stateless-session-descriptor>
                <pool>
                    <initial-beans-in-free-pool>25</initial-beans-in-free-pool>
                    <max-beans-in-free-pool>50</max-beans-in-free-pool>
                </pool>
            </stateless-session-descriptor>
            <transaction-descriptor>
                <trans-timeout-seconds>600</trans-timeout-seconds>
            </transaction-descriptor>
        </weblogic-enterprise-bean>
    </weblogic-ejb-jar>The transactions this EJB spawns can last for 10 minutes.

Maybe you are looking for

  • Arch Linux on Toshiba CB30

    Hi, I just followed the instructions to make SeaBIOS default. After I set that and enabled the write protection again, it didn't boot Chrome OS? Is this normal behaviour? It also shows gbb.flags is nonzero 0x000000489 at the OS verification screen. T

  • Cannot download apex

    I tried download link for Oracle Application Express (Apex) and got nothing, empty page was loaded. The link I tried: http://www.oracle.com/technology/products/database/application_express/download.html Is something wrong on server side? Thanks Rusla

  • Wireless runs great, but printer problems...

    My Airport Extreme was a breeze to hook up and get connected to the internet, but printing is an issue. The Airport Utility sees the printer from both a macbook and a 64 bit Vista desktop, but when I try to print and get a message that says printer c

  • Purchased iBook in error. How do I return it?

    How do you return an iBook purchased in error.

  • OOPs ABAP - Beginner

    Hai this is sankar,                         OOPs in ABAP are new to me. can anybody suggest me how to move further (any useful links?) and how flow of control changes from normal abap program. thanks and regards, Sankar.