Need to refresh the jsp page

Hello Everyone,
I am not sure if I can tackle the below issue with just html or I need to control it throught my servlet, so posting it on this forum, in case it is a pure html issue, please let me know.
So here is the current situation:
My jsp page gets data from servlet and displays it in a html table. The fields are criteria, median, average...cells of average, median etc are color coded, green, yellow or red, depending on whether the criteria is met or not.
on wish list:
I want the column "criteria" to be of text type so that the user can change the criteria value and see what effect does it have on the colors of columns "average", "median" etc. I do not want to write this changed criteria value back to db, I just want my jsp page to refresh every time user changes value in criteria text box and recalculate the color code for the rest of the columns.
Here is what my jsp page looks like
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://paginationtag.miin.com" prefix="pagination-tag"%>
<html>
<body>
  <table border="1">
    <c:forEach items="${sheetDataList}" var="releaseData">
    <tr>
      <td align="center"><input type="text" name="newcriteria" value="${releaseData.releasecriteria}" size="25"></td>
      <c:set var="yellowmark" value="${0.25*releaseData.releasecriteria+releaseData.releasecriteria}"/>
      <c:choose>
        <c:when test="${releaseData.average lt releaseData.releasecriteria}">
          <td bgcolor="green" align="center"><c:out value="${releaseData.average}"/></td>
        </c:when>
        <c:when test="${releaseData.average lt yellowmark}">
          <td bgcolor="yellow" align="center"><c:out value="${releaseData.average}"/></td>
        </c:when>
        <c:when test="${releaseData.average gt yellowmark}">
          <td bgcolor="red" align="center"><c:out value="${releaseData.average}"/></td>
        </c:when>
      </c:choose>
  </table>
</body>
</html>Thanks.

I don't know what you are doing wrong in your code, but it seems like you are calling the JS function correctly. My feeling is there is some JS error occurring, maybe use a javascript debugger or some alerts to see where the problem is. I made as close a copy of your code I could (with some improvised improvements for keeping track of row counts and accessing the the values for the first 2 columns of the table). At the top I filled to Lists with data so I could cycle through the rows and columns. Then I do the JavaScript and the CSS, followed by the table generation.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
    java.util.List<java.util.List<luke.steve.RowObject>> sheetDataList = new java.util.ArrayList<java.util.List<luke.steve.RowObject>>();
    for (int r = 0; r < 10; r++) {
        java.util.List<luke.steve.RowObject> userActionData = new java.util.ArrayList<luke.steve.RowObject>();
        for(int c = 0; c < 5; c++) {
             userActionData.add(new luke.steve.RowObject());
        sheetDataList.add(userActionData);
    request.setAttribute("sheetDataList", sheetDataList);
%>
<html>
  <head>
    <script type="text/javascript">
    <!--
      function setAllColors() {
        var currentRow = 1;
        var row = null;
        while((row = document.getElementById("row"+currentRow)) != null) {
          setColors(currentRow);
          currentRow++;
      function setColors(currentRow)
        var criteria = document.forms[currentRow-1].criteria.value;
        var yellowLine = 1.25 * criteria;
        var row = document.getElementById("row"+currentRow);
        var currentCol = 2;
        do {
          var col = row.cells[currentCol];
          var colValue = col.innerHTML * 1;
               if (colValue <= criteria)  col.className = "green";
          else if (colValue < yellowLine) col.className = "yellow";
          else                            col.className = "red";
          currentCol = currentCol + 1;
        } while(row.cells[currentCol] != null);
    //-->
    </script>
    <!-- Make the clock look the way you want it to. -->
    <style type="text/css">
      .green
       background-color: green;
      .red
        background-color: red;
      .yellow
        background-color: yellow;
    </style>
    <title>Color Switcher</title>
  </head>
  <body onload="setAllColors();" onunload="">
    <table border="1">
      <tbody>
        <c:forEach var="userActionData" items="${sheetDataList}" varStatus="rowCounter">
          <tr name="row${rowCounter.count}" id="row${rowCounter.count}">
            <td>${userActionData[0].userAction}</td>
            <td><form onsubmit="setColors(${rowCounter.count}); return false;"><input name="criteria" type="text" value="${userActionData[0].releaseCriteria}"/></form></td>
            <c:forEach var="releaseData" items="${userActionData}" varStatus="colCounter">
              <td>${releaseData.ninetyPercentile}</td>
            </c:forEach>
          </tr>
        </c:forEach>
      </tbody>
    </table>
  </body>
</html>I made a dummy class called luke.steve.RowObject to hold the data (represents on releaseData object). The class just generates a bunch of random numbers for this test:
package luke.steve;
public class RowObject {
     public Integer getReleaseCriteria() {
          return Double.valueOf(Math.random()*500.0).intValue();
     public Integer getNinetyPercentile() {
          return Double.valueOf(Math.random()*500.0).intValue();
     public String getUserAction() {
          return "Action "+Double.valueOf(Math.random()*10.0).intValue();
}In this example it works in FF3 and IE7 (though it looks nicer in FF3).

Similar Messages

  • Firefox dose not refresh while ie refreshes the JSP page

    Hiii,
    I think I am in a little tricky situation here and need for your advice,
    here is the situation...
    I have a small .jsp page that contains a little jsp code and a little html code ...
    the main function of the jsp part is the adjust the "refresh content" destination...
    this is the code ..
    if (abs==1
         toGo = "a.jsp";
    if (abs==2)
              toGo = "b.jsp";
    if (abs==3)
                   toGo = "c.jsp";
    if (abs==4)
         toGo ="d.jsp";
    %>
    <meta http-equiv="REFRESH" content="10; url=<%=request.getContextPath()%>/en/<%=toGo%>">
    this code works fine in ie,
    ie, refreshes the page and decide where to go ...
    however firefox (and mozilla, may be netscape too) .. dose not refreh .. so the page stays...
    actually they are porbably refreshing but it seems that they are not running jsp again and again ..
    where is the problem ? ..
    How should I solve this problem ...
    Thank you..

    actually it makes sense but It is not working..
    event if I adject the refresh path like,
    <meta http-equiv="REFRESH" content="10; url=http://www.yahoo.com/<%=request.getContextPath()%>/<%=lang%>/event/Proposal/<%=toGo%>">
    it is not reporting an error... .. (page not found :) ) .... but it refreshes... I mean If I change the content of the html part, I get the changes from browser.. but the page is still there..

  • Values on the jsp page not loading after refresh

    Hi All,
    I have a problem in getting the values back onto the jsp page after a refresh. After the first refresh i get null values.
    Let me know what i should use: is it 1. request 2. application or 3. session scope? I have to keep my application running for ever (as long as the server is running) refreshing every 3 minutes. So i used application scope but in vain.
    Also i am using requestDispatcher and forwarding the req,res. I came to know that this method has some problems if we use request attributes. Do i need to use a send.Redirect instead?
    Let me know the correct procedure.
    Thanks in advance.

    Gouri-Java wrote:
    Hi All,
    I have a problem in getting the values back onto the jsp page after a refresh. After the first refresh i get null values.
    Let me know what i should use: is it 1. request 2. application or 3. session scope? I have to keep my application running for ever (as long as the server is running) refreshing every 3 minutes. So i used application scope but in vain.
    Also i am using requestDispatcher and forwarding the req,res. I came to know that this method has some problems if we use request attributes. Do i need to use a send.Redirect instead?
    Let me know the correct procedure.
    Thanks in advance.r u forwarding request to same page. ?
    try using sendRedirect with URL rewriting:
    for eg .
    response.sendRedirect("/myPage.jsp?id="+idValue+"");
    and access id on page submit.
    as
    request.getParameter("id");
    This should work .
    Edited by: AmitChalwade123456 on Jan 6, 2009 7:10 AM

  • Help needed urgently to get the values from the jsp page.

    hi,
    I am badly stuck into this problem.Please help me and find a solution.
    I am using ms-access and jsp.
    my database structure is as given below:
    m_emp_no | from_date | to_date | approver| status |
    1002 | 22/9/2008 | 23/9/2008|1003 |pending
    1004 | 29/9/2008 | 30/9/2008|1003 |pending
    2044 | 15/9/2008 | 16/9/2008|3076 |pending
    now this is exactly a leave apply scenario where a page is displayed and the user has to fill in the details to apply leave.then the approver has to approve that leaves so even, he should get the details in his account.
    for example here 1003 has to approve leaves for 1002 & 1004.i am able to fetch data from database for the particular approver here is the coding:
    <html>
    <body>
    <h2 align="center"><u><b><span style="background-color: #FFFFFF"><font color="#C0C0C0" face="Comic Sans MS">Leave
    Approval Requests</font></span></b></u></h2>
    <form method="POST" name="f1" action="update.jsp">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:employee_details");
    PreparedStatement p=null;
    p=con.prepareStatement("select * from emp_leave_application where approver='"+username+"'");
    ResultSet r=p.executeQuery();
    while(r.next())
    %>  <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
        <tr>
          <td width="100%" bgcolor="#999966"><b><u><%=r.getString(2)%></u></b></td>
        </tr>
      </table>
      <table border="1" width="100%" height="171" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
        <tr>
          <td width="100%" height="165" valign="top">
            <p align="left"><b>User ID</b>        :
    <input type="text" name="id" value="<%=r.getString(1)%>"  size="4   
         <b>status</b>:<%=r.getString(5)%</p>
    <p><b>Leave From</b> : <%=r.getString(2)%></p>
    <p><b>Leave From</b> : <%=r.getString(3)%></p>
    <p><b>Approve</b> : <select  size="1" name="approved">
            <option value="Approved">Approved</option>
            <option value="Cancelled">Cancelled</option>        </select></p>
    <%
    con.close();
    %>
      <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
              <tr>
                <td width="100%" bgcolor="#999966">
                  <p align="center"><input type="reset" value="Clear" name="B1"> 
                  <input type="submit" value="Submit" name="B2"></td>
              </tr>
            </table>
            </td>
        </tr>
      </table>
    </form>
    </body>
    </html>{code}
    this will display both the rows but when i try to retrieve the values into update.jsp using the code given below it gives me only one value which is the first 1002.
    {code}approved=(String)request.getParameter("approved");
    id=(String)request.getParameter("id");{code}
    but i need both the values to be inserted into the update.jsp only then the approver will be able to approve the leaves individually with respect to the m_emp_no.
    please help me out.
    thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    My comments below are all between (((((( and ))))))
    <html>
    <body>
    <h2 align="center"><u><b><span style="background-color: #FFFFFF"><font color="#C0C0C0" face="Comic Sans MS">Leave
    Approval Requests</font></span></b></u></h2>
    <form method="POST" name="f1" action="update.jsp">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:employee_details");
    PreparedStatement p=null;
    p=con.prepareStatement("select * from emp_leave_application where approver='"+username+"'");
    ResultSet r=p.executeQuery();
    while(r.next())
    %> <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
    <tr>
    <td width="100%" bgcolor="#999966"><b><u><%=r.getString(2)%></u></b></td>
    </tr>
    </table>
    <table border="1" width="100%" height="171" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
    <tr>
    <td width="100%" height="165" valign="top">
    <p align="left"><b>User ID</b> :
    <input type="text" name="id" value="<%=r.getString(1)%>" size="4   
    ((((((( in the statement above, name="id" should be changed to something like name="id"<%=ii%>
    Where ii is a counter that tells you how many times you have gone through the loop so far.
    The reason for this is that each textfield you generate must have a unique name rather than all have the same name
    such as 'id'. This change will give them names such as id0, id1, id2. Then when you submit the page, you can uniquely
    identify each input textfield.))))))
    <b>status</b>:<%=r.getString(5)%</p>
    <p><b>Leave From</b> : <%=r.getString(2)%></p>
    <p><b>Leave From</b> : <%=r.getString(3)%></p>
    <p><b>Approve</b> : <select size="1" name="approved">
    (((( the above select also has to have a unique name for each time through the loop. Change it to name="approved"<%=ii%>
    <option value="Approved">Approved</option>
    <option value="Cancelled">Cancelled</option> </select></p>
    <%
    con.close();
    %>
    <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
    <tr>
    <td width="100%" bgcolor="#999966">
    <p align="center"><input type="reset" value="Clear" name="B1">
    <input type="submit" value="Submit" name="B2"></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    (((((((note you would be better off long term to put your business logic in a servlet and dispatch to the JSP page which will only have the responsiblity to display the data.
    Also, connection pooling is better than the above.

  • Prolem with refreshing my jsp page

    Refreshing the page
    I have a jsp page with few buttons(like add, delete, save), during loading time, it loads data from database and display in a table of row data,when I clicked the delete button to delete a row, it removes a row of data from my database, but it still displays that deleted row, bcoz page has not been refreshed. Now I wrote 2 java script function, one which invokes my delete function in my Action class and another I am trying to again load the page after delete, so that I can get fresh data. But its not happening, do you have any idea, where am I going wrong, or how can I refresh my jsp page after I delete a row. I am getting my data from database and after that I put in session.
    Here is my small code base
    function invokeICCanAssignmentDeleteFunction()
          func();
          initialise();
    // this method deletes my data from DB
        function func()
         alert("alert 1");
        document.forms[0].action='/eta/canAssignment.do?mode=icCanAssignmentDelete';
         alert("alert 2");
    // this method initialise my form bean taking data from db and put in session inside my action class
        function initialise()
         alert("alert 3");
        document.forms[0].action='/eta/canAssignment.do?mode=icCanAssignment';
         alert("alert 4");
        }

    The following two javascript lines will only set the action value of the form and does nothing else. No server call will be made.
    document.forms[0].action='/eta/canAssignment.do?mode=icCanAssignmentDelete';
    document.forms[0].action='/eta/canAssignment.do?mode=icCanAssignment';You need to submit the form to make a server call. For Example:
    document.forms[0].action='/eta/canAssignment.do?mode=icCanAssignmentDelete';
    document.forms[0].submit();Google Javascript tutorials for more.

  • Pragmaticobjects : Tree view in the JSP page

    I have to understand Tree view Generation in the JSP page by using pragmaticobjects jar file.
    Can any body please help me from where I got the details of pragmaticobjects.
    I am not able to fined appropriate link in Google.
    com.pragmaticobjects.taglibs.tree.util some of the used package .

    a tree model
    wrap <ul> <ul> around all his childeren + wrap the String representation with <li> </li>
    that should provide you with the structure in html.
    <ol class="tree">
    <li>parent
      <ul>
       <li>child1.1
        <ul>
         <li>child1.1.2</li>
         <li>child1.1.2</li>
        </ul>
       </li>
       <li>child1.2
        <ul>
         <li>child1.2.1</li>
         <li>child1.2.2</li>
        </ul>
       </li>
      </ul>
    </li>
    <ul>then it's css time
    <html>
    <head>
    <style>
    <!--
    .tree {
    list-style-type: none;
    list-style-image: none;
    list-style-position: outside;
    .tree ul {
    margin: 0em;
    padding: 0em;
    .tree  li{
    border: 1px black solid;
    text-align: center;
    float: left;
    -->
    </style>
    </head>
    <body>
    <ul class="tree">
    <li>parent
      <ul>
       <li>child1.1
        <ul>
         <li>child1.1.2</li>
         <li>child1.1.2</li>
        </ul>
       </li>
       <li>child1.2
        <ul>
         <li>child1.2.1</li>
         <li>child1.2.2</li>
        </ul>
       </li>
      </ul>
    </li>
    <ul>
    </body>
    </html>from here well there are differend solutions, but I think a little too CSS orientated to discuss it here. if you need more details email I'm not sure if I check this topic again.
    Mr_Light
    stuurff [at] hotmail.com

  • ReturnToPortal() doesn't refresh the portal page

    In the community preference page, when finishing changing the preference, calling IPortletResponse.ReturnToPortal() closed the preference page but didn't refresh the portal page. What needs to be done to refresh the portal page so the portlet can be refreshed with the new pref data?
    ALUI 6.1MP1.
    TIA!

    This is why it doesn't work...
    There is a bug that I filed for this, basically that icon on the portlet header works for user and admin preferences... it make sense to add community preferences there too to make it all consistent.
    The problem is: community preferences behaved differently.. in 5.x, the only way to edit them was to go through edit this community... the refresh mechanism is built into the community editor.
    In g6 that didn't change... you still need to go through that route to actually update the portal with the new preferences. going through the icon does nothing. user and admin prefs will work b/c they also worked like that in 5.x.
    Basically, it's a bug b/c community prefs never worked like that... adding it to the button promoted the sense that it should work, which it never did...
    so you have to go through the edit this community route to make it refresh.

  • Pass the data back from the jsp page to the java code

    Hi,
    I have written an iView that receives an event using EPCF and extracts data from the client data bag.
    I need this iView to pass the data back from the jsp page to the java code.
    I am trying to do this using a hidden input field, but I cannot get the code to work.
    Here is the code on the jsp page.
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId">
    <hbj:inputField id="myInputField" type="string" maxlength="100" value="" jsObjectNeeded="true">
    <% myInputField.setVisible(false);%>
    </hbj:inputField>      
       </hbj:form>
      </hbj:page>
    </hbj:content>
    <script language=JavaScript>
    EPCM.subscribeEvent("urn:com.peter", "namedata", window, "eventReceiver");
    function eventReceiver(eventObj) {
         var url = eventObj.dataObject;
         var funcName = htmlb_formid+"_getHtmlbElementId";
         func = window[funcName];
         var ipField = eval(func("myInputField"));
         ipField.setValue(url);
         var form = document.all(htmlb_formid);
         form.submit();
    </script> 
    Here is my java code
    package com.sap.training.portal;
    import com.sapportals.htmlb.InputField;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    public class ListSalesOrder extends PageProcessorComponent {
      public DynPage getPage(){
        return new ListSalesOrderDynPage();
      public static class ListSalesOrderDynPage extends JSPDynPage{
         private String merong;
        public void doInitialization(){
        public void doProcessAfterInput() throws PageException {
              InputField reportfld = (InputField) getComponentByName("myInputField");
              if (reportfld != null)      merong = reportfld.getValueAsDataType().toString();
        public void doProcessBeforeOutput() throws PageException {
              if ( merong != null ) setJspName("merong.jsp");
              else setJspName("ListSalesOrder.jsp");
    Here is DD
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="SharingReference" value="com.sap.portal.htmlb"/>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="SearchSalesOrder">
          <component-config>
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="/pagelet/SearchSalesOrder.jsp"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
        <component name="ListSalesOrder">
          <component-config>
            <property name="ClassName" value="com.sap.training.portal.ListSalesOrder"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>
    After receive event, then call java script function "eventReceiver" and call "form.submit()".
    But .. PAI Logic in Java code doesn't called ...
    Where is my problme ?
    Help me ...
    Regards, Arnold.

    Hi Arnold,
    you should not do a form.submit yourself. Instead you can put a component called ExternalSubmit to your page:
    ExternalSubmit exSubmit = new ExternalSubmit("EX_SUBMIT"));
    exSubmit.setServerEventName("MyEvent");
    This results in a java script funtion on the page which is called "_htmlb_external_submit_". If you call this function the the form gets submitted and your event handler is called.
    regards,
    Martin

  • How to increase the size of textbox in the .jsp page of Human Workflow

    Hi All,
    I need to increase the size of the textbox in the .jsp page of Human Task.
    I am showint some text in the textbox which are currently not editable, and as the length of textbox is small, the complete text is not visible.
    If anyone know how to customize the jsp page of Human Task, please share.
    Regards,
    Vivek

    Thanks Eric,
    but i think this one is different.
    I am trying to edit the source of .jsp page in JDev. which has the code for textbox as below:
    <%=getField(payload, form, context, thisDisabled, locale, task, "CustID", "/ns0:task/ns0:payload/ns1:Customer_Verification_Data/ns1:Company_Information/ns1:CustID", "string")%>
    now how can i add some class format in .css file and how will i access that particular class in this textbox.
    Thanks,
    Vivek

  • Could not invoke the service() method when the JSP page is loaded

    I am new to servlets/jsp so excuse if I am doing something silly here:
    I have a JSP page the suppose to be loading a session attrbute from a simple servlet. When I go to load the jsp page, I get Could not invoke the service() method.
    Any help is much appreciated:
    Here is my JSP:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <%@ page session="true" import="insurance.PolicyObj,java.util.*"%>
    <% Vector VTable = (Vector) session.getAttribute("policyTable"); %>
    <HTML>
    <BODY>
    <Form name=listTable action="InsSer" method="post">
    <TABLE border="1">
         <TBODY>
              <TR>
                   <TD width="258" align="center"><B>Policy Id</B></TD>
                   <TD width="187" align="center"><B>Customer Name</B></TD>
                   <TD width="160" align="center"><B>Agent Name</B></TD>
                   <TD width="134" align="center"><B>Status</B></TD>
              </TR>
              <TR>
    <%
    for (int index=0; index < VTable.size();index++) {
    PolicyObj TableL = (PolicyObj) VTable.elementAt(index);
    %>
         <TR bgcolor="#99CCFF">
    <TD width="258" align="center"> <%= TableL.getPolicyId()%> </TD>
    <TD width="187" align="center"> <%= TableL.getCustomerName()%> </TD>
    <TD width="187" align="center"> <%= TableL.getAgentName() %> </TD>
    <TD width="187" align="center"> <%= TableL.getPolicyStatus() %></TD>
    </TR>
         <% } %>
         </TBODY>
    </TABLE>
    <P><INPUT type="submit" name="Submit" value="Refresh Active Policies"></P>
    </BODY>
    </HTML>
    Here is my servlet:
    package insurance;
    import java.io.IOException;
    import java.util.Vector;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.Servlet;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    public class InsSer extends HttpServlet implements Servlet {
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#HttpServlet()
         public InsSer() {
              super();
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              doPost(req,resp);
              // TODO Auto-generated method stub
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              //PolicyObj[] policyTable = new PolicyObj[3];
              HttpSession session = req.getSession(false);
              //if (session == null) {
                   //resp.sendRedirect("http://localhost:9080/Insurance/error.html");
              //Vector buylist = (Vector) session.getAttribute("PolicyList");
              Vector policyList = null;
              policyList.addElement(new PolicyObj());
              ((PolicyObj) policyList.get(0)).setPolicyId("0009800002");
              ((PolicyObj) policyList.get(0)).setCustomerName("Salim Zeitouni");
              ((PolicyObj) policyList.get(0)).setAgentName("Jack Smith");
              ((PolicyObj) policyList.get(0)).setPolicyStatus("Pending");
              session.setAttribute("policyTable",policyList);
              ServletContext sc = getServletContext();
              RequestDispatcher rd = sc.getRequestDispatcher("InsSev1.jsp");
              rd.forward(req,resp);
    Message was edited by:
    sfz1
    Message was edited by:
    sfz1

    I am new to servlets/jsp so excuse if I am doing something silly here:
    I have a JSP page the suppose to be loading a session attrbute from a simple servlet. When I go to load the jsp page, I get Could not invoke the service() method.
    Any help is much appreciated:
    Here is my JSP:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <%@ page session="true" import="insurance.PolicyObj,java.util.*"%>
    <% Vector VTable = (Vector) session.getAttribute("policyTable"); %>
    <HTML>
    <BODY>
    <Form name=listTable action="InsSer" method="post">
    <TABLE border="1">
         <TBODY>
              <TR>
                   <TD width="258" align="center"><B>Policy Id</B></TD>
                   <TD width="187" align="center"><B>Customer Name</B></TD>
                   <TD width="160" align="center"><B>Agent Name</B></TD>
                   <TD width="134" align="center"><B>Status</B></TD>
              </TR>
              <TR>
    <%
    for (int index=0; index < VTable.size();index++) {
    PolicyObj TableL = (PolicyObj) VTable.elementAt(index);
    %>
         <TR bgcolor="#99CCFF">
    <TD width="258" align="center"> <%= TableL.getPolicyId()%> </TD>
    <TD width="187" align="center"> <%= TableL.getCustomerName()%> </TD>
    <TD width="187" align="center"> <%= TableL.getAgentName() %> </TD>
    <TD width="187" align="center"> <%= TableL.getPolicyStatus() %></TD>
    </TR>
         <% } %>
         </TBODY>
    </TABLE>
    <P><INPUT type="submit" name="Submit" value="Refresh Active Policies"></P>
    </BODY>
    </HTML>
    Here is my servlet:
    package insurance;
    import java.io.IOException;
    import java.util.Vector;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.Servlet;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    public class InsSer extends HttpServlet implements Servlet {
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#HttpServlet()
         public InsSer() {
              super();
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              doPost(req,resp);
              // TODO Auto-generated method stub
         /* (non-Java-doc)
         * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse resp)
         protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              //PolicyObj[] policyTable = new PolicyObj[3];
              HttpSession session = req.getSession(false);
              //if (session == null) {
                   //resp.sendRedirect("http://localhost:9080/Insurance/error.html");
              //Vector buylist = (Vector) session.getAttribute("PolicyList");
              Vector policyList = null;
              policyList.addElement(new PolicyObj());
              ((PolicyObj) policyList.get(0)).setPolicyId("0009800002");
              ((PolicyObj) policyList.get(0)).setCustomerName("Salim Zeitouni");
              ((PolicyObj) policyList.get(0)).setAgentName("Jack Smith");
              ((PolicyObj) policyList.get(0)).setPolicyStatus("Pending");
              session.setAttribute("policyTable",policyList);
              ServletContext sc = getServletContext();
              RequestDispatcher rd = sc.getRequestDispatcher("InsSev1.jsp");
              rd.forward(req,resp);
    Message was edited by:
    sfz1
    Message was edited by:
    sfz1

  • Tags not recognized when compiling the jsp pages through appc

    Hi:
    I am trying to convert a web application from weblogic 9.1 to weblogic 10.3. However, when I try to build the ear file the page compilation fails with the error:
    weblogic.utils.compiler.ToolFailureException: jspc failed with errors :weblogic.servlet.jsp.CompilationException: projectFinancials.jsp:10:2: The tag handler class was not found "jsp_servlet._tags.__projectJobCostingLayout_tag
    However, the tag file is there.
    The tags are referenced through this declaration:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" 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">
    <taglib>
    <taglib-uri>http://name/app/tagfiles</taglib-uri>
    <taglib-location>/WEB-INF/tags</taglib-location>
    </taglib>
    </web-app>
    All the declarations in the jsp pages are fine. In weblogic 9.1 I don't have any problem. I also set the <backward-compatible>true</backward-compatible> in weblogic.xml.
    Any idea?
    Thanks!

    There is no need to use tld files with tag files when it comes to running the ear file through appc. When I do development I use a tld file that contains references to all the tag files, however my build process replaces that with the tag files directory:
    So, during development I have:
    web.xml:
    <taglib>
    <taglib-uri>http://name/cps/tagfiles</taglib-uri>
    <taglib-location>/WEB-INF/tld/mytags.tld</taglib-location>
    </taglib>
    mytags.tld:
    <taglib 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-jsptaglibrary_2_0.xsd"
    version="2.0">
    <tlib-version>1.0</tlib-version>
    <short-name>mytags</short-name>
    <uri>mytaglib</uri>
    <tag-file>
    <name>agreementDetailsLayout</name>
    <path>/WEB-INF/tags/agreementDetailsLayout.tag</path>
    </tag-file>
    During the build I have:
    web.xml:
    <taglib>
    <taglib-uri>http://name/app/tagfiles</taglib-uri>
    <taglib-location>/WEB-INF/tags</taglib-location>
    </taglib>
    If I don't do this appc will have a fit of even bigger proportions (more error messages etc.)

  • Is it possible to refresh the home page or report page automatically?

    Hi.
    I'm develping EM plugin with EM 11 extensibility.
    Is it possible to auto refresh the home page or report page?
    It contains the view data(real time 30 sec page..) select list combo at the matric detail page.
    and it is displayed on the right of the top at the database main page
    Thanks,
    wonjo.
    Edited by: wonjo on Oct 5, 2010 10:49 PM

    Also, there are enhancements in progress to the extensibility framework which will, in future versions of EM, allow this type of control over chart/table refresh for plugins.

  • Junk characters like" � � "displayed in the jsp page please help.

    Hi,
    I am getting junk characters like � � displayed in the jsp page.
    In the JSP page i used javascript "& nbsp" for appending spaces to a string "CCR" to get "CCR " .
    Now the Resultant string "CCR " has three spaces appended to its right.
    This String is set in session in that JSP page.
    In the next JSP page i am getting that string from session.
    After getting the string the "substring" function is performed to get only the first 5 charcters of the string. Now the result is displayed as " CCR� � " with has last 2 characters as junk values � � insteed of displaying as "CCR ". Please help me in solving this issue.
    Please note that initially the sting "CCR" is got from the Oracle database in Solaris Machine.
    Regards,
    Vijay

    have you tried:
    strenuously inspecting the string that is coming from the db? do an actual loop over the string, character by character, dumping to System.out to make sure the characters are EXACT coming out of the db.
    note you have to append " " not just "& nbsp"
    post the code that is doing the output. the relevant bean code, the jsp, everything relevant - WITH COMMENTS discussing where things are happening.
    Also, is it "weird characters" in the browser only? have you done a view source on the actual html source that the browser is rendering (right click in IE and click view source). browsers can act odd if you don't feed then exactly what they want, and it looks like you're feeding it escaped characters that it is rendering as something else.

  • Please help me with the jsp page

    Hi,
    I have a parent jsp page. I have a button in that page. If I click the button in the parent page, a child page will be opened which consists of huge data. I have set an option such that if I click the jsp page it asks to open directly or save so as to edit the data in MSWORD format. The child page has a print button at the end of the page which prints all the data. But since the data is very vast I want page breaks at certain places so that when I edit the data and click print button it prints the data with page breaks at certain points. I know that in MSWORD we have page breaks. But I should not do it manually as there would be thousands and thousands of pages to be printed.
    ANY IDEA OR HELP IN THIS MATTER IS GREATLY APPRECIATED. I HAVE BEEN TRYING TO SOLVE THIS MATTER AND POSTED IN MANY SITES. BUT NOBODY RESPONDED. ATLEAST PLEASE LET ME KNOW IF THE IDEA WHICH I MENTIONED IS WORNG OR NOT.
    THANKYOU
    MOUNTAINEER

    use java report?

  • Iam trying to reinstall the OS X after erasing the hard disc but it can't be completed it says u need to visit the purchase page ??? I tried many time to download it any help

    Iam trying to reinstall the OS X after erasing the hard disc but it can't be completed it says u need to visit the purchase page ??? I tried many time to download it any help

    On the bottom of the MBP is the serial number.  Enter it here and post back the results:
    https://getsupport.apple.com/GetSASO?
    This will identify the exact MBP that you have.
    Ciao.
    The system is under maintenance now.  Try this link instead:
    http://www.chipmunk.nl/klantenservice/applemodel.html
    Message was edited by: OGELTHORPE

Maybe you are looking for

  • Kernel panic won't go away and can't boot?

    I am not sure what OS I have. It's an iMac and only a year and a half old. I know it doesn't have leopard and that's about it. Anyway, my problem started two days ago. I got the notification that updates were available so I went ahead and did it. I w

  • Project WBS not visible in SRM

    Hi All, We have created Shopping cart in SRM and user wants to do shopping with respect to the particular Project (WBS Element). except of that project all other projects are visible in SRM. That Project is released and active in ECC System. My quest

  • Allow creation of Self Registered Users

    Under Portal Settings in the Admin section is a checkbox to "Allow creation of Self Registered Users". And a note that says "Changes in these settings will take effect immediately." I'd like to utilize this feature and have therefore checked the box,

  • Solaris Environment Manager maxs out memory.

    We have a forte system in production, running on two Solaris 2.6 boxes. Each has its own environment and they are connected. Our environments are called "Data Center" and "Call Center". Our Forte memory settings are fairly standard. We start at 20Mb

  • Operation confirmation display in REM

    Hi, In my REM scenario, I am doing backflushing in MFBF, this leads to auto goods issue and auto GR of finished product( No reporting point backflushing). I am doing 'Post with correction' and then entering qty for goods issue and then actual timing