JSP Tags - Refreshing tag data

I have written a few custom Tag Handlers.
I built these Handlers to eliminate all scriptlet code from a JSP form page, and also for ease of reuse.
A few of the Handlers generate '<select>' tags, which have option values populated by a call to another Class object that performs a database query.
All of the tags work perfectly, however, the tags that rely on database calls for the values do not get rebuilt, thus the values do not reflect current table data - This was not a problem when the options where generated via scriptlets; the data was rebuilt any time the page was refreshed.
Is there a method available to signal the container to rebuild the tags each time the page is refreshed/called?

sounds like a caching problem.. if so, you can test this by putting print statements in the page and reloading the page. If nothing prints, the server isn't getting the request, just the browser reloading from cache. if that is the case, then you need to be putting in the proper no-cache headers. I forget them offhand, but if you search this forum for "Pragma no-cache" you'll definitely find a post with the full set (there's a few things to set).

Similar Messages

  • Problems in developing custom JSP tags

    I have problems in debugging custom JSP tags. Sometimes the doStartTag is not called on tags but the doEndTag is called. I don't know why.
    Thanks.

    Fahr--
    A word of caution -- NetUI did not ship a JSP tag SDK in 8.x, and
    we're making no compatibility guarantees for custom JSP tags written on
    the 8.x release and future releases.
    You can accomplish the same sort of functionality with a combination
    of the <netui-data:getData> tag and JSTL 1.0. This solution would
    probably provide similar functionality and be more future-proof relative
    to JSTL and the NetUI tags currently being developed in Beehive.
    Hope that helps.
    Eddie
    Fahr Vegnugen wrote:
    We are in the midst of creating our own JSP tags to work with datasources.
    In an example where you would need to compare two different datasources how would you do this?
    ie.
    <prefix:isGreater dataSource="{pageflow.column1}" dataSourceToCompare="{pageFlow.column2}" />
    How would I evaluate what column2 is since the tag will only resolve one data source
    this.evaluateDataSource();
    Any pointers you can provide would be appreciated, or if there is a library of jsp tags that evaluate objects using datasources already created, that would even be better.

  • How html textfield use i jsp tag

    hi master
    sir see my php code i get input in name and fname text box and pass in php tag for insertion into database
    <html>
    <body>
    <form action="mfa.php" method="post">
    First Name<input type="text" name="fname">
    Second Name<input type="text" name="lname">
    <input type="submit" name"Insert">
    </form>
    <?php
    //Inserting records into database
    $firstname=$_POST['fname'];
    $lastname=$_POST['lname'];
    mysql_connect("localhost","root","") or die(mysql_error());
    mysql_select_db("test1");
    mysql_query("INSERT INTO persons (Firstname, Lastname) VALUES ('$firstname','$lastname')");
    echo "Data Inserted";
    ?>
    <?php
    //showing resutls in browser
    mysql_connect("localhost", "root", "") or die(mysql_error());
    mysql_select_db("test1") or die(mysql_error());
    $result = mysql_query("SELECT * FROM persons") or die(mysql_error());
    echo "<table border='1'>
    <tr>
    <th>First Name</th>
    <th>Last Name</th>
    </tr>";
    while($row = mysql_fetch_array( $result ))
    echo "<tr>";
    echo "<td>" . $row['Firstname'] . "</td>";
    echo "<td>" . $row['Lastname'] . "</td>";
    echo "</tr>";
    echo "</table>";
    ?>
    </body>
    </html>
    how i use html text box and pass to jsp tag for insertion data into database
    please give me sample code
    thank's
    aamir

    I have never had any problems mixing straight HTML (without the verbatim tag) and JSF tags. OTOH, I use facelets, not JSPs, so my experience may not be applicable.

  • Urgent - DocumentManager,Configurations and JSP Tags

    I am using Vignette as the content repository.I am able to fetch data and display
    on the jsp when a single VignetteDocumentProvider is being used and data coming
    from a single content table.
    Problem is - If I have multiple classes for the VignetteDocumentProvider that
    are to be used to display data from several tables on the jsp.
    Q 1) How to configure multiple DocumentManager and DocumentConnectionPool nodes
    in meta-inf\application-config.xml for those multiple VignetteDocumentProvider
    classes.
    Q 2) On the same JSP - How would the jsp tags reference multiple VignetteDocumentProvider
    classes.
    Could someone PLEASE help.
    Thanks a LOT in advance.
    Regards,
    shikha

    You may be better off asking the question to Vignette.
    .raja
    "shikha" <[email protected]> wrote in message
    news:3caa2bf7$[email protected]..
    >
    I am using Vignette as the content repository.I am able to fetch data anddisplay
    on the jsp when a single VignetteDocumentProvider is being used and datacoming
    from a single content table.
    Problem is - If I have multiple classes for the VignetteDocumentProviderthat
    are to be used to display data from several tables on the jsp.
    Q 1) How to configure multiple DocumentManager and DocumentConnectionPoolnodes
    in meta-inf\application-config.xml for those multipleVignetteDocumentProvider
    classes.
    Q 2) On the same JSP - How would the jsp tags reference multipleVignetteDocumentProvider
    classes.
    Could someone PLEASE help.
    Thanks a LOT in advance.
    Regards,
    shikha

  • F:invokeUrl jsp tag and child objects

    Hey all,
    Does anyone know if its possible to use the f:invokeUrl tag on a method in a child object? eg:
    <f:invokeUrl var="myObject.myChildObject" methodName="myMethod" />
    I've also tried:
    <f:invokeUrl var="${myObject.myChildObject}" methodName="myMethod" />
    with no luck. I've gotten the above to work using the f:invoke jsp tag.
    What I'm trying to do is put my ajax type functions in the objects that make the most sense. If I can't get this to work, I'll need to make presentation objects with all my ajax functions, create an instance and put it into scope, which I rather not do.
    Thanks,
    Graham

    Graham,
    I can't say if it will work or not, because its a better practice to leave all logic outside of the jsp (and I really don't know!). Do the logic in an activity, then only use the jsp to display the values. Keeping the logic outside is a much easier way to keep track of the data, and also re-use if necessary.
    Customarily, a 'view' object is created. FileStatusView for example, would be a BPM Object that contains all the values to be displayed in a JSP or presentation.
    Hope thats helpful!
    -Kevin

  • HtML inside JSP Tag

    How much HTML can be inside a JSP Tag? I created a tag which set few variables. Now on the JSP page, if the variable A is not null, then only display value and show a link next to it.
    So is it OK, if I take the link html (href code) and concatenate with the vale of A
    Thanks in advance

    <ed:TableIterator resultId="calist">
      <tr class="altrow">
        <td class="center" style="vertical-align:top;">
          <input type="checkbox" onchange="ca.value='1';" class="cb" name="cadel" value="<ed:getColumn column="idx"/>"/>
          <input type="hidden" name="cadate" value="<ed:getColumn column="date"/>"/>
        </td>
        <td style="vertical-align:top;">
          <input type="text" onchange="ca.value='1';" class="text" name="caoms" value="<ed:getColumn column="title"/>"/>
        </td>
        <td>
          <textarea class="text" onchange="ca.value='1';" name="camemo" cols="40" rows="4"><ed:getColumn column="memo"/></textarea>
        </td>
      </tr>
    </ed:TableIterator>Loads :)
    This is a small sample, building the rows of a table with 3 columns (a checkbox, an inputfield and a textarea) for each row.
    I've built larger structures where I nest the same tags to create select controls in each row.
    I wouldn't actually create HTML inside the java class for the tag, as that violates the separation of code and presentation (that's not to say I haven't done it, but I've learned better since <GRIN> and now try to avoid it where possible and minimise it where not).

  • USE jsp TAG

    How do I use JSP tag with Weblogic?
              Where should I put my tld file, and where should I put the Java class file?
              I put the Java files under
              C:\bea\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WE
              B-INF\lib and it was not successful.
              Thank you
              

    something like this...
              OuterTag qParent = null;
              try {
                        Tag myParent = getParent();
                        while (myParent != null ) {
                          // loop up through tags until you find the one you want
                             if (myParent instanceof OuterTag) {
                                  qParent = (OuterTag) myParent;
                                  data = qParent.getSomeData();
                             } else {
                                  myParent = myParent.getParent();
                   }

  • Reading jsp  tag using xml

    Hello friends,
    I have a problem.
    I have a jsp page in that i have to find a particular tags. using xml
    but i dont know about dtd and. please help me
    example.
    <input type ="text" value= "ss">
    now i want to find the above tag using xml
    so please give me the logic how to find a tag in jsp using xml. ?
    please help me.

    A JSP is for displaying data. Read after me:D-I-S-P-L-A-Y-I-N-G. It has no business parsing or
    reading or calculating anything.
    I don't know what the OP want's to do. Maybe he
    want's to write a application which replaces some
    html tags in JSP files.
    His post can also be interpreted that he want's to
    use JavaScript (DOM)) to find any particular tag.Hello,
    my problem is in our application some programmers have written hardcode in <intput tag> like <input type name ="hardcode" instead taking values from database dictonary.
    so now i have to find the line no. where they have written the hard code.
    for that my pl is asked to solve using dom.
    for that i need to find the html tags.
    but i m not able to do that.
    can u suggest me.
    Regards

  • HOWTO?  Make JSP tags small in JDev Design

    I use the JDev Design view to quickly navigate around my JSP pages. However the visual tags become huge and make it hard to use. Is there a way to make the visual tags small; Say show only the type of tag?
    Thanks
    A

    Not sure whether you have turned on the 'Execute Tag in Visual Editor' option in Manager Libraries dialog or not.
    If you haven't turned that option on, then there is a way to just show the jsp tag name.
    Go to Tools->Preference,
    Select JSP and HTML Visual Editor
    check the 'Show JSP Tag Name Only' option
    Select OK.
    Now, go to your jsp page and hit refresh and see whether this helps.

  • Javazoom UploadBean - using UploadBean properties within jsp tags

    I am working on a jsp web application and integrating the UploadBean from javazoom.net into it. I am using a MySQL database to capture all informaion about mp3 files being uploaded - filename, date, filetype, etc.
    Can someone guide me as to whether it is possible to reference the properties of the UploadFile class within a jsp tag?
    What I am trying to do is this - I want to capture the filename of the file I upload and store it in a MySQL database. Within the SimpleUpload.jsp page, the filename is accessed within scriplet code as follows:
    file.getFileName();
    (Where file is a variable representing an instance of the UploadFile class, and getFileName() is a method in this class that returns the file name you are uploading).
    What I would like to do is use this method so that this same filename can be used in a a sql:update tag to populate a database with the filename and with the other details of the file which is uploaded.
    Can anyone advise as to if this is possible and how? I tried to create a sql:update statement to populate the database with the result of file.getFileName();
    The problem is that the sql:update jsp tag can't see the file.getFileName() object and method - it doesn't know about this object and method.
    Thanks!

    I'd still appreciate an answer to this if anyone can help.
    Thanks.

  • The JSP Tag Exception

    I have a Struts V 1.1 application that uses Tiles Pluginn also. I have a layout file in which I have Header, Left Navigation Body, and footer. The body is tiles:insert page ="....". In the body I have a fmt:parseDate tag. If the date format in that tag is invalid the JSP somehow does not redirect to the error page. I do have the error page directive as <%@ page errorPage="/error.jsp" %>. It just shows ServletException right in the jsp text redered on a client browser. I have no clue why it would not process the error page JSP directive. Any help is appreciated

    It's complaining with a NoClassDefFoundError.
    Most likely you have something in your $CLASSPATH that depends on a
    class in your WEB-INF/lib. I'd start by removing anything you've added
    to the $CLASSPATH.
    Not sure why it's working when TwoPhase is false. There should not be
    any difference. Difficult to say without more info.
    You might find this eworld presentation helpful:
    https://www.bea-eworld2004.com/published/1144/1144_woollen_AG.pdf
    -- Rob
    Shyam wrote:
    Hi,
    I am seeing this strange problem - When I deploy an application using the weblogic
    console, it sets the attribute "TwoPhase" to "true" and I get a servlet exception
    which looks like one of the jsp tag classes isn't found in classpath.(I have tried
    putting the required jar in the web-inf/lib folder & had tried using the Manifest.mf
    classpath entry of the "war" file too). The same "ear" file gets deployed fine
    if I set this "TwoPhase" to "false". I will appreciate if anyone can explain what
    going on with this attribute and why weblogic doesn't seem to be able to find
    the class in one case but not in the other.
    The error message is something like this
    javax.servlet.ServletException: org/displaytag/tags/TableTag
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:452)
    Thanks,
    Shyam.

  • Member variable for jsp tag

    Hi,
    is it safe to have member variables in jsp tag? every time service method will create new instance of tag?Thanks

    is it safe to have member variables in jsp tag? The answer is yes, but.
    every time service method will create new instance of tag?no, it will not necessarily create a new instance every time.
    For most tags I believe the spec allows for a 'pool' of tag handlers to be retained.
    Certainly I have seen this happen in tomcat.
    An exception is the JSP2.0 SimpleTagHandler which guaruntees that it will be used once and then thrown away.
    With other tags, you have ownership of the tag and its member variables, between doStartTag and doEndTag. Nothing else can interfere with the member variables.
    However if you include the tag twice in your page, one after another, it is quite possible, that you will be given the same tag object, and thus the member variables might have variables set from the previous use of the tag.
    It is fairly easy to work around though
    in the doStart: init any member variables that are not defined by attributes to be their default values
    in the doEnd method, clean up your member variables. Clear any attribute values that might be optional. Set things to null. That way you are guarunteed that if the tag is reused, it won't pick up any data from your run through here.
    But don't take my word for it :-) Try it out.
    Hope this helps,
    evnafets

  • Error(1): java.lang.ClassNotFoundException: oracle.cabo.ui.jsps.tags.ListOf

    Iam getting the following errors when I try to compile my jsp. But when I compile it om another pc it works fine
    Error(1): java.lang.ClassNotFoundException: oracle.cabo.ui.jsps.tags.ListOfValuesTEI
    Error(1): Unable to load taghandler class: http://java.sun.com/jstl/core
    Iam using jdev IDE 9.0.3.10.35
    below is the code Iam trying to compile. Is it a bug Iam experiencing or faulty code??????
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <HTML>
    <HEAD>
    <TITLE>  </TITLE>
    <LINK rel="stylesheet" type="text/css" href="../style/sheet.css">
    <script language="JavaScript">
    function confirmDelete(id) {
      var ans = confirm("Weet U zeker dat U deze allocatie wilt verwijderen?");
      if (!ans) return;
      window.document.SelectionForm.action="../servlet/colossus.servlets.DeleteAllocation";
      window.document.SelectionForm.selectedID.value=id;
      window.document.SelectionForm.url.value=document.location;
      window.document.SelectionForm.submit();
    function modify(id) {
      url = escape(window.document.location);
      window.document.location="../servlet/colossus.servlets.ModifyAllocation?allocID="+escape(id)+"&url="+url;
    </script>
    </HEAD>
    <BODY topmargin=10 leftmargin=15 >
    <table border="0" cellPadding="5" cellSpacing="0" width="472">
      <tr>
        <td bgcolor="#ffffff">     
          <table border="0" cellPadding="2" cellSpacing="0" width="462">
            <tr>
              <td class="kopbalk" width="440"><P class="kop"> <b>Allocaties bekijken</b></P></td>
              <td width="22"></td>
            </tr>
            <tr>
              <td width="440" height="10"></td>
              <td width="102" height="10"></td>
            </tr>
            <tr>
              <td width="440">
                <table width="440" cellpadding="2" cellspacing="0" border="0">
             <form name="SelectionForm" action="../servlet/colossus.servlets.ShowAllocations" method="get">
               <input type="hidden" name="selectedID" value="" />
               <input type="hidden" name="url" value="" />
               <c:if test="${!(empty errorMsg)}">
               <tr>
                 <td colspan="2" class="error"><p><c:out value="${errorMsg}" /></p></td>
                  </tr>
                  </c:if>
                  <tr>
                    <td width="130"><P>Van <FONT size="1">(dd-mm-jjjj)</FONT></P></td>
                    <td width="310"><P>
              <INPUT type="text" name="startDay" size="2" maxlength="2" value="<c:out value='${param.startDay}'/>"> -
              <INPUT type="text" name="startMonth" size="2" maxlength="2" value="<c:out value='${param.startMonth}'/>"> -
              <INPUT type="text" name="startYear" size="4" maxlength="4" value="<c:out value='${param.startYear}'/>"> om
              <INPUT type="text" name="startHour" size="2" maxlength="2" value="<c:out value='${param.startHour}'/>"> :
              <INPUT type="text" name="startMinute" size="2" maxlength="2" value="<c:out value='${param.startMinute}'/>">
              </P></td>
                  </tr>
                  <tr>
                    <td width="130"><P>Tot <FONT size="1">(dd-mm-jjjj)</FONT></P></td>
                    <td width="310"><P>
              <INPUT type="text" name="endDay" size="2" maxlength="2" value="<c:out value='${param.endDay}'/>" > -
              <INPUT type="text" name="endMonth" size="2" maxlength="2" value="<c:out value='${param.endMonth}'/>"> -
              <INPUT type="text" name="endYear" size="4" maxlength="4" value="<c:out value='${param.endYear}'/>"> om
              <INPUT type="text" name="endHour" size="2" maxlength="2" value="<c:out value='${param.endHour}'/>"> :
              <INPUT type="text" name="endMinute" size="2" maxlength="2" value="<c:out value='${param.endMinute}'/>">
              </P></td>
                  </tr>
                  <tr>
                    <td width="130"><P>Vestiging</P></td>
                    <td width="310"><P>
                      <SELECT name="vestigingID">
                  <c:forEach items="${offices}" var="office">
                          <option value="<c:out value='${office.ID}'/>" <c:out value="${office.selected}" /> >
                            <c:out value="${office.name}"/>
                          </option>
                  </c:forEach> 
                      </SELECT>
                    </P></td>
                  </tr>
               <tr>
                 <td colspan="2" width="440">
                <div align="center"><input type="submit" value="- Ok -"></div>
              </td>
               </tr>
             </form>
                </table>
              </td>
              <td width="102"> </td>
            </tr>
            <tr>
              <td width="440"> </td>
              <td width="102"> </td>
            </tr>
            <tr>
              <td colspan="2">
                <table width="542" cellpadding="0" cellspacing="0" border="0">
    <!--// begin van de tabel //-->
    <c:if test="${!(empty allocs)&&(empty errorMsg)}">
    <TABLE border="0" cellpadding="1" cellspacing="1" bgcolor="#000000" width="572">
      <TR>
        <TD bgcolor="#ffffff" width="30"><P> </P></TD>
        <TD bgcolor="#ffffff" width="80" align="center"><P><B>Verdieping</B></P></TD>
        <TD bgcolor="#ffffff" width="80" align="center"><P><B>Ruimte</B></P></TD>
        <TD bgcolor="#ffffff" width="80" align="center"><P><B>Van</B></P></TD>
        <TD bgcolor="#ffffff" width="80" align="center"><P><B>Tot</B></P></TD>
        <TD bgcolor="#ffffff" width="200" align="center"><P><B>Omschrijving</B></P></TD>
      </TR>
      <c:forEach items="${allocs}" var="alloc">
        <TR>
          <TD bgcolor="#ffffff" width="30" align="center">
            <a href="javascript:modify('<c:out value="${alloc.ID}" />')"><IMG src="../images/edit.gif" border="0" alt="Allocatie wijzigen"></a><a href="javascript:confirmDelete('<c:out value="${alloc.ID}" />')"><IMG src="../images/delete.gif" border="0" alt="Allocatie verwijderen"></a>
          </TD>
          <TD bgcolor="#ffffff" width="80" align="center"><P><c:out value="${alloc.floorNumber}" /></P></TD>
          <TD bgcolor="#ffffff" width="80" align="center"><P><c:out value="${alloc.roomNumber}" /></P></TD>
          <TD bgcolor="#ffffff" width="80" align="center"><c:out value="${alloc.shortStartDate}" /><br>
                                                          <c:out value="${alloc.startTime}" /></TD>
          <TD bgcolor="#ffffff" width="80" align="center"><c:out value="${alloc.shortEndDate}" /><br>
                                                          <c:out value="${alloc.endTime}" /></TD>
          <TD bgcolor="#ffffff" width="200" align="left"><P><c:out value="${alloc.description}" /></P></TD>
        </TR>
      </c:forEach>
    </TABLE>
    </c:if>
    <!--// einde van de tabel //-->
                </table>          
              </td>
            </tr>
                       </TABLE>
        </td>
      </tr>
    </table>
    </BODY>
    </HTML>

    Olival,
    Is your application using UIX ? Seems like it from the error. The class you are getting the error on
    Erro: java.lang.ClassNotFoundException: oracle.cabo.ui.jsps.tags.RenderingContextTEI"
    is part of uix2.jar, which is available in JDev environment, but not under standalone
    OC4J. Hence the error.
    -Prasad
    Hi,
    I'm getting this error when trying to run my struts app:
    "500 Internal Server Error
    OracleJSP: oracle.jsp.parse.JspParseException: Nzmero da Linha 1, <%@ taglib uri="/WEB-INF/struts-logic.tld"
    prefix="logic" %>
    Erro: java.lang.ClassNotFoundException: oracle.cabo.ui.jsps.tags.RenderingContextTEI"
    The error msg is localized to my country (Brazil), so "Nzmero da Linha" translates to "Line Number", and "Erro" means "Error".
    The error comes from the 1st page called by the application (index.jsp), wich uses the struts redirect tag.
    Strange enough, this error only shows on OC4J 9.0.3 stand-alone (got the latest version today from OTN), but when calling from JDeveloper 9.0.3 (production), using the embedded OC4J, everything's ok.
    Has anybody experienced the same error ?
    Tnxs,
    Olival Jr.

  • JSP TAG

    HI,
    Could you please tell me what is the purpose of the tag,
    <META HTTP-EQUIV="Refresh" CONTENT="5;URL=somefile.jsp">
    Thanks,
    Kumar.

    thats not a JSP tag question thats basic HTML, do a google search and read up on meta-tag it will help you in your further HTMl endavours

  • Experiences developing iViews with JSP tags

    Hi,
    has anyone experiences in the development of iViews using JSPs and the JSP tags ? Especially the useBean tag... I think it should be no problem to store beans in the session. If I want to share the bean among iView is it enought to synchronized each method of the bean ?
    Thanks

    Hi O.,
    please, before going on guessing around what synchronization means, read some tutorial, that's what the link was thaught for. It is no problem at all not to know this topic, it's definitely some more advanced topic within the language, but it doesn't help if you don't know it to guess how it <i>could</i> work/behave.
    > if I declare all getters and setters of the bean with
    > synchronize I avoid the issue of inconsistent data
    Once again: For pure getters and setters this sentence is definitely wrong. As long as complex class members are not manipulated / accessed concurrently, there is no need for synchronization (within the class).
    > thread 1 sets a value a concurrent thread 2
    > could read the data and would get a not actual value...
    > if I synchronize the get and set, thread 2 will be
    > able to invoke the getter after thread 1 finished the
    > setter.
    Once again: You don't have it in your hands which thread comes first. And synchronizing a method only means that a thread calling this method will run through it as an atomic operation, no other thread will disturb. But getters and setters normally are atomic, you cannot reach more... If a thread calls two (synchronized) methods of the same object, between these two calls, "the race is open again...".
    A good example is http://www-106.ibm.com/developerworks/java/library/j-threads1.html
    See the example at the end of this link, that's somehow just what we are talking about. The solution would be to synchronize the <i>setFoo(getFoo() + 1)</i> itself (for example with the bean object as locker). Whereas the synchronization of the methods is superfluous (and time consuming).
    Hope it helps
    Detlev

  • Include jsp tags

    I am having a problem relacing the include file of let's call it a
    header.jsp in a menu page named menu.jsp.
    So in my header.jsp file let's say I do something simple like
    <table>
    <tr><td><jato:href name="first">First Option
    </jato:href></td></tr></table>
    and so on....
    And in my main.jsp I have a simple include at the top of my page
    like so
    <html
    <body>
    <%include file=header.jsp%>
    etc.
    Now when JRun 3.0 makes the include replacement, it seems to have a
    problem where it tells me
    Servlet error 500
    com.iplanet.jato.view href : taglib navigation not found
    BUT when I take out the jato tags in the include file...I can get
    JRun to make the replacement perfectly....
    Does anyone else have this problem and if so how did you get around
    it?

    Sorry to bother you again, but I couldn't find anything that looked strange
    is this file. Can you send us the original file at our personal email
    addresses? I'd like to see exactly where the compilation error occurs and
    it's not possible with the file inlined here.
    todd.fast@e...
    michael.frisino@s...
    Thanks,
    Todd
    ----- Original Message -----
    From: <suket@u...>
    Sent: Wednesday, January 17, 2001 2:02
    Subject: [iPlanet-JATO] Re: include jsp tags
    Hi Mike,
    Both of the jsp files (pgHelp.jsp and pgFooter.jsp)
    are in the same folder. I removed the IPP/ipp portion in the
    include directive but still giving the same err.
    iam using Allair Jrun 3.0.
    Here is the intermediary generated Jsp file
    / Generated by JRun, do not edit
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import allaire.jrun.jsp.JRunJSPStaticHelpers;
    public class jrun__IPP__ipp__pgHelp2ejsp13 extends
    allaire.jrun.jsp.HttpJSPServlet implements
    allaire.jrun.jsp.JRunJspPage
    private ServletConfig config;
    private ServletContext application;
    private Object page = this;
    private JspFactory __jspFactory = JspFactory.getDefaultFactory();
    public void _jspService(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, java.io.IOException
    if(config == null) {
    config = getServletConfig();
    application = config.getServletContext();
    response.setContentType("text/html; charset=ISO-8859-1");
    PageContext pageContext = __jspFactory.getPageContext(this,
    request, response, null, true, 8192, true);
    JspWriter out = pageContext.getOut();
    HttpSession session = pageContext.getSession();
    try {
    out.print("\r\n\r\n");
    IPP.ipp.pgHelpViewBean viewBean = (IPP.ipp.pgHelpViewBean)
    pageContext.getAttribute("viewBean", PageContext.REQUEST_SCOPE);
    if(viewBean == null) {
    if(JRunJSPStaticHelpers.getAndSetBean(pageContext,
    "viewBean", IPP.ipp.pgHelpViewBean.class
    , PageContext.REQUEST_SCOPE, 3)) {
    viewBean = (IPP.ipp.pgHelpViewBean)pageContext.getAttribute
    ("viewBean", PageContext.REQUEST_SCOPE);
    } else {
    viewBean = (IPP.ipp.pgHelpViewBean)pageContext.getAttribute
    ("viewBean", PageContext.REQUEST_SCOPE);
    pageContext.setAttribute("viewBean",viewBean);
    out.print("\r\n");
    com.iplanet.jato.taglib.UseViewBeanTag useViewBean__4_1 =
    (com.iplanet.jato.taglib.UseViewBeanTag)
    JRunJSPStaticHelpers.createTagHandler(pageContext,
    "com.iplanet.jato.taglib.UseViewBeanTag");
    useViewBean__4_1.setPageContext(pageContext);
    useViewBean__4_1.setParent(null);
    useViewBean__4_1.setClassName("IPP.ipp.pgHelpViewBean");
    int useViewBean__4_1_startVal = useViewBean__4_1.doStartTag();
    JRunJSPStaticHelpers.checkStartVal
    ("com.iplanet.jato.taglib.UseViewBeanTag",useViewBean__4_1_startVal,Bo
    dyTag.EVAL_BODY_INCLUDE,4);
    if(useViewBean__4_1_startVal == BodyTag.EVAL_BODY_INCLUDE) {
    com.iplanet.jato.view.ContainerView currentView =
    (com.iplanet.jato.view.ContainerView)pageContext.getAttribute
    ("currentView");
    com.iplanet.jato.view.TiledView currentTiledView =
    (com.iplanet.jato.view.TiledView)pageContext.getAttribute
    ("currentTiledView");
    out.print("\r\n<HTML>\r\n<HEAD><!--jato:text name=\"stTemp\"
    fireDisplayEvents=\"true\" escape=\"true\" /--><!-- Added Temporarily
    by ravindran on 8th jan 2001 -->\r\n");
    com.iplanet.jato.taglib.TextFieldTag textField__7_1 =
    (com.iplanet.jato.taglib.TextFieldTag)
    JRunJSPStaticHelpers.createTagHandler(pageContext,
    "com.iplanet.jato.taglib.TextFieldTag");
    textField__7_1.setPageContext(pageContext);
    textField__7_1.setParent(useViewBean__4_1);
    textField__7_1.setSize("20");
    textField__7_1.setMaxLength("20");
    textField__7_1.setFireDisplayEvents("true");
    textField__7_1.setName("tbUserID");
    textField__7_1.doStartTag();
    if(textField__7_1.doEndTag() == Tag.SKIP_PAGE) {
    if(true) return;
    out.print("\r\n<TITLE>pgHelp</TITLE>\r\n</HEAD>\r\n<body BGCOLOR=
    \"white\" bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" vlink=
    \"#800080\" alink=\"#FF0000\">\r\n");
    com.iplanet.jato.taglib.FormTag form__11_1 =
    (com.iplanet.jato.taglib.FormTag)JRunJSPStaticHelpers.createTagHandler
    (pageContext, "com.iplanet.jato.taglib.FormTag");
    form__11_1.setPageContext(pageContext);
    form__11_1.setParent(useViewBean__4_1);
    form__11_1.setMethod("post");
    form__11_1.setName("pgHelp");
    int form__11_1_startVal = form__11_1.doStartTag();
    JRunJSPStaticHelpers.checkStartVal
    ("com.iplanet.jato.taglib.FormTag",form__11_1_startVal,BodyTag.EVAL_BO
    DY_INCLUDE,11);
    if(form__11_1_startVal == BodyTag.EVAL_BODY_INCLUDE) {
    out.print("\r\n");
    if(form__11_1.doEndTag() == Tag.SKIP_PAGE) {
    if(true) return;
    out.print("\r\n");
    com.iplanet.jato.taglib.UseContainerViewTag view__1_1 =
    (com.iplanet.jato.taglib.UseContainerViewTag)
    JRunJSPStaticHelpers.createTagHandler(pageContext,
    "com.iplanet.jato.taglib.UseContainerViewTag");
    view__1_1.setPageContext(pageContext);
    view__1_1.setParent(null);
    view__1_1.setName("IPP.ipp.pgFooterViewBean");
    int view__1_1_startVal = view__1_1.doStartTag();
    JRunJSPStaticHelpers.checkStartVal
    ("com.iplanet.jato.taglib.UseContainerViewTag",view__1_1_startVal,Body
    Tag.EVAL_BODY_INCLUDE,1);
    if(view__1_1_startVal == BodyTag.EVAL_BODY_INCLUDE) {
    currentView = (com.iplanet.jato.view.ContainerView)
    pageContext.getAttribute("currentView");
    currentTiledView = (com.iplanet.jato.view.TiledView)
    pageContext.getAttribute("currentTiledView");
    com.iplanet.jato.view.ContainerView
    IPP.ipp.pgFooterViewBean = (com.iplanet.jato.view.ContainerView)
    pageContext.getAttribute("IPP.ipp.pgFooterViewBean");
    out.print("\r\n<hr color=red size=2>\r\nfrom new_footer.jsp in
    IPP/ipp directory\r\n<font size=\"-2\" face=\"Arial\"><i>Send
    comments to <a href=\"mailto:supportdept@a...\">Any
    Company</a></i></font>\r\n<hr color=red size=2>\r\n");
    com.iplanet.jato.taglib.HiddenTag hidden__6_1 =
    (com.iplanet.jato.taglib.HiddenTag)
    JRunJSPStaticHelpers.createTagHandler(pageContext,
    "com.iplanet.jato.taglib.HiddenTag");
    hidden__6_1.setPageContext(pageContext);
    hidden__6_1.setParent(view__1_1);
    hidden__6_1.setFireDisplayEvents("true");
    hidden__6_1.setName("hdFooter");
    hidden__6_1.doStartTag();
    if(hidden__6_1.doEndTag() == Tag.SKIP_PAGE) {
    if(true) return;
    out.print("\r\n");
    if(view__1_1.doEndTag() == Tag.SKIP_PAGE) {
    if(true) return;
    out.print("\r\n");
    out.print("\r\n</BODY> \r\n</HTML>\r\n");
    if(useViewBean__4_1.doEndTag() == Tag.SKIP_PAGE) {
    if(true) return;
    } catch(Throwable t) {
    if(t instanceof ServletException)
    throw (ServletException) t;
    if(t instanceof java.io.IOException)
    throw (java.io.IOException) t;
    if(t instanceof RuntimeException)
    throw (RuntimeException) t;
    throw JRunJSPStaticHelpers.handleException(t,
    pageContext);
    } finally {
    __jspFactory.releasePageContext(pageContext);
    public String getServletInfo()
    return "pgHelp";
    private static final String[] __dependencies__ =
    {"/IPP/ipp/pgHelp.jsp",null};
    private static final long[] __times__ = {979720473658L,0L};
    public String[] __getDependencies()
    return __dependencies__;
    public long[] __getLastModifiedTimes()
    return __times__;
    public int __getTranslationVersion()
    return 14;
    it is generating 2 semicolons automatically..
    near pageContext.getAttribute("IPP.ipp.pgFooterViewBean");
    regards
    ravi
    In [email protected], "Mike Frisino" <Michael.Frisino@S...>
    wrote:
    Hi Suket,
    I just retested something very similar to this in 1.0.
    Essentially, i took an existing page which included a tiledView.
    I moved the TiledView jsp block into an entirely separate jsp file.
    I then replace the TiledView jsp block in the original jsp with aninclude
    <%@ include file="TiledGetOrders.jsp"%>
    It worked like a charm.
    So I am not sure what is wrong in your case.
    Could be a jrun bug?
    I have tested in resin 1.2.1
    To do proper analysis, we would need to see
    1. The intermediary .java file that the jsp engine creates, andthen tries
    to compile.
    C:/Program
    Files/Allaire/JRun/servers/default/ipp/WEB-INF/jsp/jrun__IPP__ipp__pgHelp2ej
    sp.java
    Can you send that to us?
    Incidentally, although we do not think a problem there would causethe
    compile time error you are seeing,
    i am curious about your file value.
    <%@ include file="/IPP/ipp/pgFooter.jsp"%>I did not need to use a qualified file name, although my includetarget file
    was in the same directory as the
    page that was including it. What is the file system relationshipbetween
    your top level page "pgHelp" and the include
    target "pgFooter".
    Are they in same or diff directories?
    ----- Original Message -----
    From: <suket@u...>
    Sent: Tuesday, January 16, 2001 9:42 PM
    Subject: [iPlanet-JATO] Re: include jsp tags
    Hi,
    We tried to follow the steps described by you to have
    dynamic include in a jsp page.
    my jsp file content is
    <%@p... info="pgHelp" language="java"%>
    <%@t... uri="/WEB-INF/jato.tld" prefix="jato"%>
    <jsp:useBean id="viewBean" class="IPP.ipp.pgHelpViewBean"
    scope="request"></jsp:useBean>
    <jato:useViewBean className="IPP.ipp.pgHelpViewBean">
    <HTML>
    <HEAD>
    <jato:textField name="tbUserID" size="20" maxLength="20"
    fireDisplayEvents="true" />
    <TITLE>pgHelp</TITLE>
    </HEAD>
    <body BGCOLOR="white" bgcolor="#FFFFFF" text="#000000"
    link="#0000FF" vlink="#800080" alink="#FF0000">
    <jato:form name="pgHelp" method="post">
    </jato:form>
    <%@ include file="/IPP/ipp/pgFooter.jsp"%>
    </BODY>
    </HTML>
    </jato:useViewBean>
    This is my pgFooter.jsp
    <jato:view name="IPP.ipp.pgFooterViewBean">
    <hr color=red size=2>
    from new_footer.jsp in IPP/ipp directory
    <font size="-2" face="Arial"><i>Send comments to <a
    href="mailto:<a href="/group/SunONE-JATO/post?protectID=061075104115193209050223163176249165134048139046">supportdept@a...</a>">Any Company</a></i></font>
    <hr color=red size=2>
    <jato:hidden name="hdFooter" fireDisplayEvents="true" />
    </jato:view>
    There is no compilation error in pgFooterViewBean and in
    pgHelpViewBean.
    How ever iam getting a runtime error,
    500 Internal Server Error
    /ipp/servlet/IPP.ipp.ippServlet:
    javax.servlet.ServletException: Compilation error occured:
    allaire.jrun.scripting.DefaultCFE:
    Errors reported by compiler:C:/Program
    Files/Allaire/JRun/servers/default/ipp/WEB-
    INF/jsp/jrun__IPP__ipp__pgHelp2ejsp13.java:105:50:105:50: Syntax:
    expected instead of this token
    What could be the reason for this error message?
    We tried the same thing with another approach, instead of using
    include directive, we directly copied the code of pgFooter.jsp in
    pghelp.jsp.
    even that is giving the same error..
    <%@p... info="pgHelp" language="java"%>
    <%@t... uri="/WEB-INF/jato.tld" prefix="jato"%>
    <jsp:useBean id="viewBean" class="IPP.ipp.pgHelpViewBean"
    scope="request"></jsp:useBean>
    <jato:useViewBean className="IPP.ipp.pgHelpViewBean">
    <HTML>
    <HEAD>
    <jato:textField name="tbUserID" size="20" maxLength="20"
    fireDisplayEvents="true" />
    <TITLE>pgHelp</TITLE>
    </HEAD>
    <body BGCOLOR="white" bgcolor="#FFFFFF" text="#000000"
    link="#0000FF" vlink="#800080" alink="#FF0000">
    <jato:form name="pgHelp" method="post">
    </jato:form>
    <jato:view name="IPP.ipp.pgFooterViewBean">
    <hr color=red size=2>
    from new_footer.jsp in IPP/ipp directory
    <font size="-2" face="Arial"><i>Send comments to <a
    href="mailto:<a href="/group/SunONE-JATO/post?protectID=061075104115193209050223163176249165134048139046">supportdept@a...</a>">Any Company</a></i></font>
    <hr color=red size=2>
    <jato:hidden name="hdFooter" fireDisplayEvents="true" />
    </jato:view>
    </BODY>
    </HTML>
    </jato:useViewBean>
    Please give us a feasible solution to solve this problem.
    Thx
    Ravi
    --- In [email protected], "Todd Fast" <Todd.Fast@S...>wrote:
    Craig & Eric--
    (If you're not interested in the resolution to the problem Craigposted,
    please skip ahead to the section in which I describe the
    preferred
    technique
    for including headers and other common content in a JATO page.
    This
    discussion is very important because I introduce the concept of"view
    compostion", in which JATO pages are composed of modular andreusable view
    components. This is one of the most powerful new features of
    JATO,
    and a
    capability that simply wasn't possible in NetDynamics.)
    Posted Problem Resolution
    Craig & Eric, from what I can tell, you are both trying to
    include
    a full
    view bean in a parent page at translation time. This is notpossible, as
    you can see from the compiler errors you get. There are
    collisions
    when
    multiple top-level tags are included in the same JSP.
    When I said earlier that you needed to use a translation-timeinclude
    instead of a run-time include, I was assuming that you were
    trying
    to
    include a fragment of HTML/JSP in the parent page. By
    fragment, I
    mean HTML
    or JSP content that does not declare a view bean or form, but
    rather
    references views contained within the parent view bean. If youwant to
    include a full page (JSP + ViewBean) in another page, then you'dneed to use
    a run-time include. A run-time include temporarily pauses therendering of
    the current page, and sends the full request to the included
    page
    as if it
    were a separate client request. The resulting content from theincluded
    page is inlined into the parent page's content, and processing
    of
    the parent
    page then continues.
    Now I realize after thinking about it a bit that we may not have
    sufficiently provided for full page includes because of some
    late-
    breaking
    changes in the request context handling. After some basic
    testing,
    it
    appears that if you try to include one JATO page in another byreferencing
    the JSP, the included page will cause a class cast exception tooccur.
    There may also be problems because the request context on theincluded page
    will not have been set. In any case, full JATO page inclusionlooks like
    it's an issue we're going to have to address with some fixes
    before
    it will
    work properly. My apologies. (One workaround if this is
    necessary
    is to
    make the included view bean a child view of the parent view
    bean.
    I won't
    go into that however).
    How to Include Common Content
    Now, on to the discussion of the preferred way of including
    common
    content
    in a JATO page. Let's say you have a common header you want toinclude in
    one or more of your JATO pages. Because of the issue I notedabove, and the
    fact that the header is not really independently displayable,
    you
    don't want
    to do a run-time include (which, remember, would necessitateincluding a
    full JATO page).
    Instead, you should include the header as an HTML/JSP fragmentusing a
    translation-time include. Depending on whether your header hasdynamic
    information, you can do one of two things. If the header is
    just
    static
    content and/or set of links, you can just reference the HTMLfragment in the
    parent HTML directly, and you won't need any kind of view or
    view
    bean to
    back it, or any reference to anything in JATO.
    If you need some dynamic info in the header, like the module URLfor a link,
    you can reference the parent page's view bean for this
    information
    by simply
    including references to the parent page's implicit JSP variables(viewBean,
    currentVIew, and currentTiledView). For example:
    Parent JSP:
    <jsp:useBean id="viewBean" class="..."scope="request"></jsp:useBean>
    <jato:useViewBean className="..." fireChildDisplayEvents="true">
    <%@ include file="MyInclude.jsp" %>
    </jato:useViewBean>
    Included content (MyInclude.jsp):
    ... viewBean.getRequestContext().getModuleURL() ...
    The final HTML with the included content would then look like
    this:
    <jsp:useBean id="viewBean" class="..."scope="request"></jsp:useBean>
    <jato:useViewBean className="..." fireChildDisplayEvents="true">
    ... viewBean.getRequestContext().getModuleURL() ...
    </jato:useViewBean>
    MyInclude.jsp will be inlined in the parent JSP before it istranslated to a
    servlet. Note that it does not include the full HTML tags
    normally
    found in
    an HTML file--there are no <html>, <head>, or <body> tags
    because
    it is not
    expected to be used outside of an include page. In effect,
    this is
    the
    equivalent of a server-side include (SSI).
    Now, if you need truly dynamic info in the header, like say youwant to
    display the user's name and SSN, then you'd likely want to
    embed a
    child
    view in the parent view bean which will encapsulate & provide
    the
    necessary
    information. This is in contrast to actually making these
    fields
    direct
    children of the the parent view bean, which would be a tedious
    and
    error
    prone task on every page you wanted to include this information.Let me try
    to contrast these two approaches with a diagram of parent-child
    relationships:
    Here's the bad way:
    ParentViewBean (ViewBean)
    |
    +-- UserFirstName (StaticTextField)
    |
    +-- UserSSN (StaticTextField)
    In this situation, you'd need to provide the logic to populatethese fields
    in every view bean on which they appeared. This is tedious andessentially
    eliminates the "common"-ness of the content (this is also whatNetDynamics
    forced people to do).
    Now, the better way:
    ParentViewBean (ViewBean)
    |
    +-- MyHeaderView (MyHeaderView.java)
    |
    +-- UserFirstName (StaticTextField)
    |
    +-- UserSSN (StaticTextField)
    In the better way, you can see that the header information isencapsulated
    in an instance of "MyHeaderView", which is a subclass ofContainerViewBase
    or one of the other ContainerView subtypes. The population of
    the
    data
    fields is encapsulated in that view, and the parent view need
    not
    know
    anything about what's actually being displayed by that view.
    Thus, you can see that MyHeaderView, in conjunction with a
    snippet
    of JSP
    content in a companion file, is completely modular and can beembedded in
    any parent view bean on which you want the header to appear.
    The
    only
    requirement is then to include MyHeaderView as a child view of
    the
    parent
    view bean, and to include the correct JSP content that
    references
    that child
    view.
    The included JSP content would now look something like this:
    <jato:view name="MyHeaderView">
    <table>
    <tr><td>... <jato:staticText name="UserFirstName"/>
    ...</td></tr>
    <tr><td>... <jato:staticText name="UserSSN"/> ...</td></tr>
    </table>
    </jato:view>
    If we now included this content in the parent JSP from furtherabove, we get
    the following as the JSP content before it is translated into aservlet:
    <jsp:useBean id="viewBean" class="..."scope="request"></jsp:useBean>
    <jato:useViewBean className="..." fireChildDisplayEvents="true">
    <jato:view name="MyHeaderView">
    <table>
    <tr><td>... <jato:staticText name="UserFirstName"/>
    ...</td></tr>
    <tr><td>... <jato:staticText name="UserSSN"/> ...</td></tr>
    </table>
    </jato:view>
    </jato:useViewBean>
    Ultimately, this technique is called "view compostion" or "view
    aggregation", and is one of the major new features of JATO. Youcan now
    define reusable view components and embed them in multiple viewcontainers,
    on the same page or on different pages. Each page acts as a
    frame,
    in which
    you provide the contents from modular components. Using thistechnique, you
    can develop reusable view classes and chunks of JSP that can bearbitrarily
    combined into complex pages.
    I know this is a long and rambling discussion, but I hope I've
    made
    myself
    at least partly clear. I'm more than happy to clarify anything
    or
    elaborate
    more. Please let me know.
    Todd
    Todd Fast
    Senior Engineer
    Sun/Netscape Alliance
    todd.fast@e...
    [email protected]
    [email protected]

Maybe you are looking for