In struts Can't display dynamic content using "include"?

Hi everyone:
I am using struts1.1. I have a index.jsp and it have a hyperlink "<html:link forward="show">Show All forum</html:link>". In my struts-config.xml there is a element:"
<global-forwards>
<forward name="show" path="/jsp/allarticle.jsp"/>
<forward name="oneforum" path="/article.jsp"/>
          <action path="/article" type="lyo.hotmail.bbs.lovearticle.Savelovearticle" input="/jsp/error.jsp">
          <forward name="success" path="/jsp/loveforum.jsp"/>
</action>
I want that the index.jsp will redirect to allarticle.jsp when user click the hyperlink "Show All forum".
In the allarticle there is a hyperlink "<html:link forward="oneforum">one forum</html:link>"
The Savelovearticle is an Action class and it disply all the data from database.I using "if(list!=null){
          session.setAttribute("listtable",list);
     }".I display all the content using "<logic:iterate id="love" name="listtable">
" tag in allarticle.jsp.
But the Tomcat report error "can't find listtable in any scope"?
The problem is if I change the struts-config.xml to:
////////////////////////after change///////////////////////////////////////////
<global-forwards>
<forward name="show" path="/article"/>
<forward name="oneforum" path="/article.jsp"/>
          <action path="/article" type="lyo.hotmail.bbs.lovearticle.Savelovearticle" input="/jsp/error.jsp">
          <forward name="success" path="/jsp/loveforum.jsp"/>
</action>
It will display all the content successfully.Why?
Whether because that the Action is a servlet so it must retrieve a request directly.My first code don't send the request to the servlet other than send the request to a jsp page.The jsp page can't send the same request to the servlet so the error happened.right?
How do I fix it?Thks :(

You want to be using <html:link forward="YOUR_FORWARD"> only when you want to forward to static elements and not elements that require actions. So in index.jsp, since you just want to forward to a static jsp page (allarticle.jsp), you can use
<html:link forward="show">Show All forum</html:link>But since you want your "one forum" link to populate a session attribute BEFORE loading /jsp/loveforum.jsp, you need
<html:link action="article">one forum</html:link>The reason it's not working now is because you're accessing a session attribute that isn't populated becuase you link to the page statically and it never gets the value of "list" actually stored in the session.
The reason it works when you change your forward element is because it calls the action that saves "list" into your session.

Similar Messages

  • RoboHelp 8: can't display TOC content using Chrome

    I just converted from X5 to RH 8. I can open a single Web page in Chrome, but when I click on any of the buttons (Contents, Index, Search, Glossary), they do not work and displaying nothing. I've scoured the boards and found Peter's 103 snippet (http://www.grainge.org/pages/snippets/snippets.htm) and applied it to no effect. What am I missing??? Thanks.

    Okay, I have a fix (thanks to Tulika at Adobe) for those of you who are interested.
    I understand you are using Chrome 5 to view RH 8 output. Chrome 5 has a strict security policy for html pages viewed locally (from disk and not from some web server) because of which iframes in RH 8 output fail to load. If you publish the same output to any web server and view it in Chrome from there, it will work just fine for you.
    To enable local viewing of your output, you will have to disable this extra security check in chrome. You can do that by launching Chrome.exe with "--allow-file-access-from-files" option. Kindly ensure that you close all open Chrome instances and then launch Chrome with this option.
    You can find more details about this security issue in Chrome at this link : http://blog.chromium.org/2008/12/security-in-depth-local-web-pages.html
    Here's what I did to implement this fix and locally (and correctly) view my help in Chrome:
    Create a NEW Chrome shortcut on the desktop and rename it to RH Chrome (or some such indicator).
    Right-click the new Chrome icon and choose Properties.
    Add the "--allow-file-access-from-files" text to the end of the path displaying in Target, as shown in the below image. Make sure you leave a space between the original string and the tag you are adding to the end of it.
    Click OK to save.
    If you have any Chrome instances open, close them.
    To test, launch an instance of Chrome using the shortcut you created.
    Go to your file system and right-click any .html file in your RoboHelp WebHelp directory and choose Open with and then Google Chrome. Please note that I had to add Chrome as an "Open with" option. Because you have your customized instance of Chrome already opened, Help will auto-launch using that instance. I'm sure there's a better way to auto-launch this from RoboHelp itself, but this was a quick and dirty test just to make sure it was working.

  • Display Table contents using HTMLB...Urgent Help Plz...

    Hello All,
    Im working on EP SP14 and SQL Server 2000.
    I have successfully established database connection.
    I want to know <b>how can I display Table contents using TableViewModel in HTMLB</b>.
    Please help.
    Its urgent.
    Awaiting Reply.
    Thanks in advance,
    Uday<b></b>

    See /thread/80270 [original link is broken]
    (please stop crossposting every question into two forums; thanks in advance)

  • Error in displaying dynamic contents in tableview?

    Hi Experts,
                     I am developing a jspDynpage which displays dynamic contents in a tableview. ie, the contents are retrieved from LDAP  Active directory. But i am getting wrong number of results. For example,
    If i give last name as Name1,
    MAIL       COMPANY           NAME             PHONE
    UsrMail    Company1       Fnm,Name1        +1 23456 397                                                                               
    Line 1 / 1
    Displays the name one time.
    first name - name2
    MAIL       COMPANY           NAME             PHONE
    UsrMail    Company2        Fnm,Name2       +1 789654 397
    UsrMail    Company2        Fnm,Name2       +1 789654 397
    UsrMail    Company2        Fnm,Name2       +1 789654 397
    UsrMail    Company2        Fnm,Name2       +1 789654 397                                                                               
    Line 1 / 4
    Repeating  the name 4 times.
    Lastname - name3
    MAIL          COMPANY           NAME             PHONE
    UsrMail       Company1       Frstnm,Name3       +1 654321 356
    UsrMail       Company1       Frstnm,Name3       +1 654321 356
    UsrMail       Company1       Frstnm,Name3       +1 654321 356
    UsrMail       Company1       Frstnm,Name3       +1 654321 356
    UsrMail       Company1       Frstnm,Name3       +1 654321 356
    UsrMail       Company1       Frstnm,Name3       +1 654321 356
    UsrMail       Company1       Frstnm,Name3       +1 654321 356
    UsrMail       Company1       Frstnm,Name3       +1 654321 356
    UsrMail       Company1       Frstnm,Name3       +1 654321 356
    UsrMail       Company1       Frstnm,Name3       +1 654321 356                                                                               
    Line 1 / 10
    Repeating  the name 10 times.
    But in Active directory the names are unique .Please Guide me.
    Thanks in advance.
    Regards,
    Krishnan

    Hi
        The problem is with Vector which i used to store the retirved information.
    After cleared that i got the proper result.
    I thought the problem is with tableview.But it is not.
    Note: To clear the vector i used Vec.clear() method. It doesn't work. So i created that vector newly inside the loop.
    Regards,
    Krishnan

  • How can I display all content (graphics)

    On Skynet (United airlines employee website), when I try to look at the "seat selection" window, it displayes only numbers, it does not display a graphic of the cabin (seats). How can I display all content?

    You can see that it is a font issue by the appearance of the little boxes with the hex code of the characters that Firefox displays when there is no font that covers this Unicode range. You might see a different character in case you would have a font that maps this font.

  • Reg. can we display alv grid using field groups (extracts)

    Hi,
    can we display alv grid using field groups (extracts). is this possible. i have to develop a blocked alv.
    tnks
    Yerukala Setty

    No, you will need the data in an internal table to use ALV.
    Cheers
    Allan

  • Can we display report by using Tree node?

    hi all
    can we display report by using Tree node if yes then plz guide me
    sarah

    In the object-navigator in the form there is node named "Reports". Create a new entry and name it "REPORT".
    To call the report use something like the following code:
    DECLARE
      rep REPORT_OBJECT;
      vcServer VARCHAR2(100);
      vcJobId VARCHAR2(100);
      vcUrl VARCHAR2(2000);
      vcServer VARCHAR2(200) := 'PUT_YOUR_REPORTS_SERVERNAME_HERE';
    BEGIN
      rep:=FIND_REPORT_OBJECT('REPORT');
      SET_REPORT_OBJECT_PROPERTY(rep, REPORT_FILENAME, 'put_the_filename_of_your_report_here');
      SET_REPORT_OBJECT_PROPERTY(rep, REPORT_DESTYPE, CACHE);
      SET_REPORT_OBJECT_PROPERTY(rep, REPORT_DESFORMAT, 'PDF');
      SET_REPORT_OBJECT_PROPERTY(rep, REPORT_SERVER,vcServer);
      vcJobId := RUN_REPORT_OBJECT(RO_Report_ID, PL_ID);
      vcJobId := SUBSTR(vcJobId, LENGTH(vcServer) + 2, LENGTH(vcJobId));
      vcUrl:= '/reports/rwservlet/getjobid' || vcJobId || '?server=' || vcServer;
      WEB.SHOW_DOCUMENT(vcUrl, '_blank');
    END;

  • Adding pagination in report build from PL/SQL dynamic content using htp.p

    Hi,
    I have a requirement for which i used PL/SQL dynamic content to build my report and i displayed my report using a cursor and loop by HTP.P function.
    Now problem is I have report with more than 500 rows and I want to add pagination concept for this report.
    How can i do that?
    Thanks in advance.
    Regards,
    Smith

    To preserve heading on each page for a HTML table you can use the THEADER, TFOOTER and TBODY tags (see example). To force page breaks, try experimenting with these style attributes:
    <STYLE TYPE="text/css">
         tr.breakhere {page-break-before: always}
    </STYLE>
    <tr class="breakhere">Table Example:
    htp.tableopen;
    htp.print('<THEAD style="display:table-header-group">');
    ... your table headers here
    htp.print('</THEAD>');
    htp.print('<TFOOT style="display:table-footer-group"><TR><TD></TFOOT>');
    htp.print('<TBODY>');
    ... your rows here
    htp.print('</TBODY>');
    htp.tableclose;Edited by: crokitta on Apr 8, 2009 2:07 PM

  • Writing dynamic content using JspWriter

    In my jsp I call a java object this java object calls jspWrtiter.print("some string");
    this prints string that is fine.Suppose I want to write any taglibrary or include another jsp this way is it possible ?
    for example below is my jsp
    <%@ taglib uri="/tld/struts-bean" prefix="bean"%>
    <% myobject..generate(new MyPageContext(pageContext)); %>
    <!-- jsp END -->
    <! -- inside myObject -->
    JspWriter out = getPageContext().getOut();
    out.print("<html></html>");
    out.print("<jsp:include page='jsp/include.jsp' />");
    the second line where I say jsp:include, prints as it is, it does not include that jsp.Is there any way I can have dynamic content not just html through JspWrite print method ?
    miro.

    out.print("<jsp:include page='jsp/include.jsp' />");this is perfectly iilegal as jsp tags are always executed at the server side but not at the client side.
    therefore that would only print something like
    <jsp:include page='jsp/include.jsp' /> in the client broswer page.
    the other way which i can think of is using iframes if you wanna do it @client side.
    something like
    out.println("<iframe src='jsp/include.jsp'  width='100' height='100'  scrollable='no' />");and the other way is making use of AJAX calling the JSP and getting back the content from the JSP and then updating a DIV / SPAN field accordingly.
    Hope this might help :)
    REGARDS,
    RaHuL

  • MIME-TYPE is stored incorrectly sometimes, browsers can't display html content

    Our company is switching from Netscape Communicator to Internet Explorer 5.5 . This resulted sometimes in html-documents which could not be opened in netscape anymore, but caused the save-as dialogue box to pop-up.
    Analysis of this problem, with the aid of Oracle Support, showed some html-documents were stored in WWV_DOCUMENT with mime-type application/octer-stream. This is a mime type which should trigger the save-as pop-up dialogue in browsers. Netscape acts accordingly, but IE does display the content normally.
    The following events cause this problem:
    1. create a html document using a microsoft office product (word/excel)
    2. DON'T close the document in the office application
    3. Use the portal wizard to upload the file to a content area
    4. Use table WWV_THINGS and WWV_DOCUMENT and see mime-type isn't text/html but application/octet-stream
    5. IE shows the file, NN wants to save it.
    The workaround to this problem is to close the file in MSOffice before uploading it.
    Oracle Development confirmed it's the browser which sends this incorrect mime-type, and portal just stores this type. It seems this mime-type is overruling the extension to mime-type mapping in the configuration of Apache, using AddType or the file mime.types.
    So the mime-types defined in apache are only used outside mod_plsql, that is, when files from the filesystem of the webserver itself are used.
    When uploading a zip-file, and unzipping it in the database, all files get the right mime-type. It seems in this situation the mime-type is determined by looking either at the file-extention or the magic bits.
    Oracle says it's a microsoft bug, so I'll have to ask Bill for a fix.
    They are probably right, and I think I could reproduce this using CGI-scripting without modplsql and portal.
    But:
    It seems not logically to me that it depends on the method of uploading files (single files, or zipped files) which method of mime-type determination is used.
    Furthermore, I find it strange that it depends on the storage location of the file (database or filesystem) which mime-type is presented at the user.
    I'd like to hear your opinions about this
    Regards,
    Ton Haver

    You want to be using <html:link forward="YOUR_FORWARD"> only when you want to forward to static elements and not elements that require actions. So in index.jsp, since you just want to forward to a static jsp page (allarticle.jsp), you can use
    <html:link forward="show">Show All forum</html:link>But since you want your "one forum" link to populate a session attribute BEFORE loading /jsp/loveforum.jsp, you need
    <html:link action="article">one forum</html:link>The reason it's not working now is because you're accessing a session attribute that isn't populated becuase you link to the page statically and it never gets the value of "list" actually stored in the session.
    The reason it works when you change your forward element is because it calls the action that saves "list" into your session.

  • Need to display dynamic content on portal page

    I have an htmldb application that a client can upload doctor profiles for the web users to lookup and find a doctor within a certain radius. When they click on the doctor's name, it shows a profile of the doctor. I need to be able to display this information directly on the oracle portal instead of iframing it because i need it to be searchable. I created an xml report in htmldb and linked it to the oracle portal with an omniportlet. The test page can be seen at [http://portal2.bynum.com/portal/page/portal/test/xml%20data%20test]
    I need the link on the go to a page in portal and display the information from the database like it does on htmldb. Is it possible to:
    1. Add a drop down box in the omniportlet that allows me to chose all doctors whose last name begins with the letter in the dropdown box.
    2. Point the link to oracle portal, pass the object_id to the page, and display the doctor profile all in the portal instead of iframing from htmldb.

    Ok, i found the solution. I created a page with the parameters that i want passed in order to display the datbase content. the parameters where created in the page properties section for the page. I created id, first_name, and last_name parameters. Then i created a dynamic pl/sql web page with the dynamic html portlet included with oracle and tied those parameters to the queries. Dynamic content is now displayed when the omniportlet links to the page.

  • Maintaining dynamic content using TC

    I'm using the full TC suite to create documentation.
    So far, I've found it pretty beneficial with a few issues.
    The issue below is my most painful and requires a lot of overhead.
    - I'd like to be able to have dynamic content in my help only
    and not have this content overwritten during an update (I use Frame
    as source and update to the help system). For example, I'd like to
    have a related topics button at the bottom of each topic, or a link
    to a next step. Unfortunately, during update from Framemaker, all
    my dynamic content is overwritten even if I create it and
    conditionalize it for help in the Framemaker source. The only
    workaround I've found is to have the file ignored during update,
    which obviously defeats the purpose of single-sourcing to begin
    with.
    Anyone have suggestions?

    I've not used the Struts template library, but try something like:
    ....content='<%="/inc" + section %>'or if that fails,
    <%
    String s = "/inc" + section;
    %>
    ...content='<%=s%>'

  • How can I display comments when using poll

    hi Experts,
    I am using wc11.1.1.5 with poll function, I published a poll with some questions and a text box for suggestion feedback, when I check result, I can only get answers for the question but no suggestions can be displayed, how can I get the suggestion displayed?
    Best regards

    You have to customize surveyResults.jsff page fragment that is available in "WebCenter Polls and Surveys Service View" library. You can find this library by creating a WebCenter Spaces Task flow Customization project from Jdeveloper. Kindly do let me know if you need more details in this regard.
    You have add output or label in surveyResults.jsff and then map its value attribute with RE of suggestion text area might be available in surveyResultBean class.
    How to customize task flow, pls see following link:-
    http://download.oracle.com/docs/cd/E21764_01/webcenter.1111/e10148/jpsdg_taskflows.htm#BACIEGJD

  • Display dynamic content

    Hi
    Hoping anyone can help I am currently using Livecycle Designer ES2.
    The current form has a subform which contains drop downs, notes section and price fields. These three fields are repeated 4 times each has different selections in the drop downs, different typed notes and different prices.
    Example
    drop down 1: unit a, unit b, unit c
    note 1: user typed
    price: 23.99
    drop down 2: unit a, unit b, unit c
    note 2: user typed
    price: 45.99
    and so on
    What is currently being produced is a invoice page showing all four sections regardless if there is any data in the fields which is leaving blank spaces on the invoice sheet.
    What i would like to happen is that if drop down 1 and 4 and filled in then on the invoice page it only shows those 2 one after the other with out having gaps where the other should be if filled in.
    Any help or examples would be appreciated
    Many Thanks

    Thanks for the reply.
    The main issue is not to do with having the forms hidden/visable
    I will try to explain better.
    On the last page i have 4 subforms which are hidden.
    Depending on the conidtions from the drop down list on the form anyone of the 4 subforms can become visble while the others remain hidden.
    The problem starts when subform 2 and 4 are visble and subform 1 and 3 are hidden. There are empty gaps where subform 1 and 3 are. But the end result should be subform 2 and 4 next to each other so there are no gaps while subform 1 and 3 remain hidden.
    Its a case of moving the subforms so that the document flows without gaps
    Hope that explains it more
    Thanks.

  • How to display dynamic images using Struts

    I am storing the image name in bean. I want to use the <html:img> tag to display my images. How can i do that using struts.
    Something or sort..
    <html:img src=bean:write name="pageEntry" property="pageImg"/>
    Thank You

    * In your web.xml file, add the struts-html-el.tld definition from the struts\contrib\struts-el\lib directory
    * Add this tag library to your JSP page; something like:
    <%@ taglib uri="WEB-INF/struts-html-el.tld" prefix="html-el" %>* Refer to the following example:
    <html-el:img src="${pageEntry.pagePic}" />* This assumes that pageEntry is a Bean, and pagePic is a bean variable accessed by the getPagePic() method.

Maybe you are looking for