Using different content with template tag (struts)

I developed a page according to the examples on the following link.
http://jakarta.apache.org/struts/api/org/apache/struts/taglib/template/package-summary.html
my problem is, that i want to use different pages as content. How can i do this?? do i need, to write multiple pages like this??
<%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template'>
<template:insert template='/chapterTemplate.jsp'>
<template:put name='title' content='Templates' direct='true'/> <template:put name='header' content='/header.html' />
<template:put name='sidebar' content='/sidebar.jsp' />
<template:put name='content' content='/introduction.html'/>
<template:put name='footer' content='/footer.html' />
</template:insert><%/*"introduction.jsp"Specify template for this page (chapterTemplate.jsp).The chapterTemplate.jsp defines the layout positions for fiveelements: title, header, sidebar, content, and footer.Specify the source file (html or jsp) for each element.*/%>

slight typo .. corrected version
<definition name="master" path="/chapterTemplate.jsp"> 
  <put name="title" value="title.jsp" /> 
  <put name="sidebar" value="sidebar.jsp" />        
  <put name="body" value="body.jsp" /> 
  <put name="footer" value="footer.jsp" />
</definition>
<definition name="a.struts.def" extends="master"> 
  <put name="body" value="anotherBodyA.jsp" />
</definition>
<definition name="b.struts.def" extends="master"> 
  <put name="body" value="anotherBodyB.jsp" />
</definition>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Problems using different scope with useBean

    Hi all,
    I've been trying over and over to place the data from my inputForm.jsp in request, session or even application scope and then try to retrieve the data from my process.jsp.
    I can't understand why not the request object (emp) is available in my second jsp file. I'm having the same problem using sessionScope and applicationScope.
    inputForm.jsp
    <jsp:userBean id="emp" class="Employee" scope="request">
    <jsp:setProperty name="emp" property="*" />
    </jsp:userBean>
    <form method="POST" action="process.jsp>
    <input type="text" name="firstName">
    <input type="text" name="lastName">
    </form>process.jsp
    <c ut value="${requestScope.emp.firstName}" />

    The useBean tag has to be on the page WHERE THE BEAN IS BEING used.
    The jsp:setProperty tag works from request parameters. So it has to be on the page that is RECEIVING the parameters - ie your second page.
    You misspelled jsp:useBean.
    Also your Employee bean must be in a package, and the useBean tag should use its fully qualified package name.
    I will presume that your Employee class has appropriate get/set methods for firstName and lastName - ie getFirstName() and setFirstName()...
    Try this:
    inputForm.jsp
    <form method="POST" action="process.jsp>
    <input type="text" name="firstName">
    <input type="text" name="lastName">
    </form>process.jsp
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <jsp:useBean id="emp" class="com.mypackage.Employee" scope="request">
      <jsp:setProperty name="emp" property="*" />
    </jsp:useBean>
    <c:out value="${requestScope.emp.firstName}" />

  • Help with nesting tags (STRUTS)

    Hi,
    I'm having a few problems with the following nested tag:
    <input name="indicator_target_<bean:write name='indicators' property='indicator_id'/>" size="10" value="<bean:write name="TargetValuesActionForm" property="indicator_target_<bean:write name='indicators' property='indicator_id'/>"/>"/>
    The page returns no getter method for "indicator_target_", but i'm not trying to get the "indicator_target_" value i'm trying to get the "indicator_target_ + id" (i.e. indicator_target_23) value. For some reason the nested _<bean:write name='indicators' property='indicator_id'/> tag which is part of the input 'value' param is being ignored?
    anyone know how I can resolve this?

    One of the first rules of JSP custom tags - you cannot use a tag as an attribute to another tag. For dynamic attributes you have to use a runtime expression. - either <%= expr %> or in a JSP2.0 container ${expr} as well.
    Your "input" tag is plain template html. So you can use custom tags for the values of the attributes.
    The one that is failing is
    <bean:write name="TargetValuesActionForm" property="indicator_target_<bean:write name='indicators' property='indicator_id'/>"/>
    I am presuming you are in a logic:iterate loop, or equivalent.
    Something like this might work:
    <bean:define id="currentId"  name='indicators' property='indicator_id'/>
    <bean:write name="TargetValuesActionForm" property="<%= "indicator_target_" + currentId %>"/>However all of this is very nasty.
    And struts can do at least part of this for you with indexed properties. You might want to take a look at them.
    Hope this helps,
    evnafets

  • Problem using different plugins via OBJECT tag

    Hi all,
    before installing JRE 1.5.0_06 everything was well. I had 3 different JREs (1.3.1_02, 1.3.1_08, 1.4.2_06) installed on one Windows system which could be invoked in Internet Explorer 6 for an applet as described in http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/version.html
    example:
    <HTML>
    <HEAD>
    <TITLE>Java Plugin 1.3.1_08</TITLE>
    </HEAD>
    <BODY>
    Java Plugin 1.3.1_08:�
    <OBJECT classid="clsid:CAFEEFAC-0013-0001-0008-ABCDEFFEDCBA" width="150" height="25">
    Plugin missing
    <PARAM name="code" value="HelloWorld.class">
    </OBJECT>
    </BODY>
    </HTML>
    (Note: The output of my HelloWorld class is the VM's version number.)
    After installing 1.5.0_06 it doesn't work anymore. The new 1.5.0_6 is always used. Does anybody have a clue?
    Thanks in advance
    Peter

    I've seen a similar problem that didn't seem to exist with JRE 1.5.0_05 but does with 1.5.0_06. On the JRE 1.5.0_06 workstation the Windows registry contains CAFEEFAC-... entries for what looks to be all 1.3/1.4/1.5 JREs and points them all to the 1.5.0_06 JRE plugin dll, even though there is still a 1.4 JRE on the workstation. So even when you specify an OBJECT tag with a classid such as classid="clsid:CAFEEFAC-0014-0001-0010-ABCDEFFEDCBA" that should load the 1.4 plugin by design, the 1.5 plugin is loaded. This seems to defeat the multi-version JRE support. The JRE 1.5.0_05 workstation on the other hand didn't overwrite CAFEEFAC-... Windows registry entries for previous JREs, and properly loads a specfic JRE's plugin when specified by a CAFEEFAC-... classid in the OBJECT tag.

  • Using different locale with date format

    Hi guys,
    I'm trying to print of the same date represented in its different locale but can't seem to get it right. I want the
    dates and times to be represented appropriately (e.g., ?Feb? should be represented as ?f?vr.? in a
    localized for France). I've also tried to use SimpleDateFormat but had no luck there either.
    Locale[] locales = { new Locale("fr", "FR"), new Locale("zh", "CN"),
                 new Locale("it", "IT") };
    for (int i = 0; i < locales.length; i++) {
                  //print date in the different locales
                  try {
                       changeLanuage(locales);
              }catch(IOException e) {
                   System.out.println("ERROR:");
              System.out.println()
    public void changeLanuage(Local loc)
    String dateString = "Sun Jan 27 01:56:00 GMT 2008"
    // Get the default MEDIUM/MEDIUM DateFormat
    String sdate = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM).format(new Date());
    System.out.println(sdate);
    try {
    Date date;
    date = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM,loc).parse(sdate);
    String output;
    output = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL,loc).format(date);
    outputStream.write(output);
    }catch(ParseException pe) {
    System .out.println("ERROR: for lanuage could not parse date in string \"" +
    dateString + "\"");
    pe.printStackTrace();
    Running the code, at the terminal i get the following output.Apr 3, 2008 5:00:03 PM
    ERROR: for lanuage could not parse date in string "Mon Jun 12 10:50:00 BST 2006"
    java.text.ParseException: Unparseable date: "Apr 3, 2008 5:00:03 PM"
         at java.text.DateFormat.parse(DateFormat.java:335)
         at readParser.changeLanuage(readParser.java:275)
         at readParser.main(readParser.java:412)
    If anyone can see what the problem is and how i can overcome it, i would greatly appreciate it if said so.
    Thanks a Lot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    okay i've attempted date --> format but this getting the same exception throw at run time.
    outputStream.write(present+" "+s.next()+"");
    String dateString = "Mon Jun 12 10:50:00 BST 2006"
    try {
         //parse with default format
          Date dtTmp = new SimpleDateFormat("MMM d, yyyy  H:mm:ss a",loc).parse(dateString);
          String strOutDt = new SimpleDateFormat("yyyy-MM-dd").format(dtTmp);
         outputStream.write(strOutDt+"DONE");
    }catch(ParseException pe) {
         System .out.println("ERROR: for lanuage could not parse date in string \"" +
         dateString + "\"");
         pe.printStackTrace();
    }Any suggestions/help would be great, thanks
    ERROR: for lanuage could not parse date in string "Mon Jun 12 10:50:00 BST 2006"
    java.text.ParseException: Unparseable date: "Mon Jun 12 10:50:00 BST 2006"
         at java.text.DateFormat.parse(DateFormat.java:335)
         at readParser.changeLanuage(readParser.java:261)
         at readParser.main(readParser.java:397)

  • How to use navigationmethod byEPCM with navigation tag libraries?

    Hi,
    we have created our own Top Level Navigation component which implements a hover meny for level 3-5. The menu works great when navigationmethod in the anchor is set to "byURL":
    <nav:navNodeAnchor navigationMethod="byURL" anchorAttributes="class='LinkLevel1u'"/>
    but we need to use "byEPCM" since we want to utilize history, forward and backwards functions of the Page Toolbar.
    When we set
    navigationMethod="byEPCM"
    our menu is not updated when the users clicks on a menu item. But in the content area the correct page/iview is shown.
    Use of byEPCM is very poorly documented, does anyone have any experience with it?

    Vegard,
    I am facing the exact same issue you had with the menu navigation not refreshing, but the content area displays the correct pages. Did you find a fix to this problem? Could you please post a reply if you did or didn't. Thanks.

  • Using different URL with iweb

    I was wondering if I could use iweb to set up a web site, but I want the address to be just a basic ".com" address. (without the .mac// stuff)
    Can I do this with a .mac account, or do I need to use a different web hosting company?

    Click here and follow the instructions, or use a different web host.
    (49756)

  • Cannot Use Rollover Functions With Templates

    I'm surprised that you do not hear anything about this, but
    if you create a template in Dreamweaver 8, your buttons will work
    but you cannot use rollover effects. That stinks! Does anyone know
    of a hack, plug in, etc. to get around this bug? It seems like i
    always find the bugs for some reason.
    Thanks for any help.

    They have always worked in every version from DW2 through the
    current CS3,
    which is what I am using.
    Show me a child page where they are not working, please, by
    posting a link
    to one.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "dsmflash" <[email protected]> wrote in
    message
    news:fakq86$6a$[email protected]..
    > Well, something must be up with my version of Dream 8
    because mine do not
    > work
    > and I have created my temps to the letter. So what
    version of Dream are
    > you
    > using and how do you get rollovers to work? How can a
    rollover effect
    > work
    > when the template is locked?
    >

  • Using web content with parameter

    Hi,
    I found the nice shuffle letters example in the DPS Tips and I like to use it in an project. It works fine and I extended it for use with a parameter. I like to set an URL like "shuffle/index.html?text=Display%20this%20text" and the shuffle script extracts the value for the text parameter and shows it. That works in the browser, but not with the web content overlay. Is there a way to use parameters in the URl with the web content?
    Thanks
    Klaus

    Your first post asked how to insert a paremeter into a SQL. My example shows a value read query with a SQL function, but any SQL will work with any Query in the same pattern.
    a) You call the query with session.executeQuery(query, vectorOfArguments);
    b) You use #argument in the SQL string and then query.addArgument("argument");
    c) You pass them in a Vector of the order in which you do the addArgument's.
    - Don

  • Problems using a variable with a tag of a webapp

    I have a webapp where I've built a field in the database for the item is active or not, depending if my client chooses if it's free or not.
    The name of the tag that I want to use as a variable is { tag_estado } and has two values:
    Gratis
    Pago
    When in jQuery I create a variable to store the value of this tag and created a conditional to activate the link and icon of the item, always the tag value prints it on "Pago", even though the webapp item has the value of "Gratis"
    I appreciate your time to help me resolve this issue.
    <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
              var linkleccionGratis = function() {
                        $(".linkLeccion").attr('href', '{tag_itemurl_withhost}?tab=video');
              var linkleccionPago = function() {
                        $(".linkLeccion").attr('href', '#dataaaaaaaa');
              var imagenGratis = function() {
                        $('.videoIcono').each(function(){
                              //Change the src of each img
                              $(this).attr('src', '/Comportamiento-Video/Iconos/1365805563_movie_studio-android-r_1.png');
              var imagenPago = function() {
                        $('.videoIcono').each(function(){
                              //Change the src of each img
                              $(this).attr('src', '/Comportamiento-Video/Iconos/1365805563_movie_studio-android-r_0.png');
        var EstadoLeccion = "{tag_estado}";
              if(EstadoLeccion == "Pago"){
                                  linkleccionPago();
                                  imagenPago();
              else if(EstadoLeccion == "Gratis"){
                                  linkleccionGratis();
                                  imagenGratis();
                        else{
                                  linkleccionPago();
    </script>
    <div style="width: 921px; margin-bottom: 10px;">
    <div class="FranjaSuperiorTituloLeccion">
    <div class="TituloContenedorLeccionWebApp">
    <div class="TituloLeccionWebApp">Lecci&oacute;n {tag_num_leccion}: {tag_titulo_leccion}</div> </div> <div class="ImagenesBotonesLeccionWebApp">
    <a class="linkLeccion" href="#data" id="inline"><img alt="Video" class="videoIcono" src="http://www.excelvirtual.org/Comportamiento-Video/Iconos/1365805563_movie_studio-android-r_ 0.png" style="margin-top: 6px; width: 31px; height: 31px;" />
    </a>
    </div>
    <div class="ImagenesBotonesLeccionWebApp">{tag_actividad url}</div>
    <div class="ImagenesBotonesLeccionWebApp">
    <a href="{tag_cuestionario}" target="_blank">
    <img alt="Cuestionario" src="http://www.excelvirtual.org/nuevodiseno/images/actividaddef2.png" style="width: 41px; height: 41px;" />
    </a>
    </div>
    </div>
    </div>

    It's tough to tell without seeing the page but it looks like your code may be defaulting to the else statement. You could delete the else and see if it does anything

  • Use different profiles with different versions of Firefox

    I want to use 2 versions of firefox (27 and AURORA) on my mac. IS there any way I can PERMANENTLY 'assign' profiles to the exact versions so one version ALWAYS opens with profile1, the other- with profile2?
    Please explain clearly.
    Thanks.

    You will have to make specific shortcuts to open a Firefox instance with a specific profile by adding -P "profile name" to the command line to launch Firefox. If no profile is specified then the profile that is selected as the last used profile in the Profile Manager will be used. It is not possible to select another profile automatically if another profile is already being used. You will have to click the correct desktop shortcut to select a specific profile.

  • Can I use different dbases with BC4J

    Hi All,
    I have been having a look at JDeveloper and in particular the Oracle Business Components for Java architecture and I was wondering how well..
    1. JDeveloper
    2. the architecture itself
    performs when using a product other than Oracle as the database for the application? Is it no problem, or will I run into quirks and difficulties. Anyone tried to use JDeveloper and BC4J with another database?
    I need to develop a web based Java application for someone, who already has a MySQL database we'd like to use. Anyone used JDeveloper and BC4J with MySQL?
    Thanks all for your time,
    Matt

    Matt, I assume you have seen our doc on
    using BC4J against foreign data sources,
    but for those that have not, here is a
    pointer to the relevant portions of
    the doc: About Developing Business Components for Foreign Datasources. It includes some sections
    on limitations.
    I do not have any specific info on MySQL..
    Bill
    ----

  • Using JEditorPane.selected() with embedded tags.

    Ok, I've been searching the forums and tutorials for about an hour tonight, and I've seen this question asked in many forms but never answered.
    I am writing an applet which uses embedded HTML and some custom tags in a sub-class of JEditorPane that I wrote. I need to be able to get the position of certain tags within the text, which I can do using the JEditorPane.getText() method. But now that I've found the right tags, how can I highlight text contained within them in the visible Pane?
    e.g.:
    getText() returns
    <html>
    <head>
    </head>
    <body>
    Check</shu_ind> this <shu_dep>out</shu_dep>
    </body>
    </html>
    And these shu tags are the ones I want to use. I can parse the text and grab the right position, but when I select(begin,end), it's off by a lot b/c select() doesn't look at any embedded info.
    What can I do?

    I don't think it's the same as I'm doing. Essentially, I have a JEditorPane subclass, which just has a few custom tags in it. I don't need them to be recognized by java, since it will be uneditable, but I just need to know how to convert from the getText() locations to the actual displayed text locations.
    Also, when I set the text as text/html, it creates a bunch of extra HTML tags, so it's larger than the original String used to create it.

  • Using  Request Processor with JSF (No Struts)

    Hi
    Im doing some analysis on JSF. My requirement is that I do need the Request Processor of struts to be fit in my architecture. However we are not using Struts. How can the same be achieved using JSF?
    Any help would be much appreciated
    Thanks

    Hi
    Im doing some analysis on JSF. My requirement is that I do need the Request Processor of struts to be fit in my architecture. However we are not using Struts. How can the same be achieved using JSF?
    Any help would be much appreciated
    Thanks

  • Using a viewobject with foreach tag in .jsp

    Hi guys I have the following scenario:
    1- I call a certain .jsp page
    2- a controller class (extends servlet) is called, this class: takes a view object (let's call it view), executes it's query, forwards the result to the jsp page.
    3- jsp page has a foreach tag that iterates over the query result.
    My problem is that foreach tag only takes list or array in its "items" attribute.
    Now is there a way to put the view object result in an array/list? in other words in my servlet what should I put in the request so that the foreach tag can iterate over the rows of the query. Thank you in advance for the reply.

    This code works fine for me:
    <%@ taglib uri="/jstl-c" prefix="c" %>
    <html>
         <body>
         <%
              int array[] = new int[] {1,2};
              session.setAttribute("array", array);
              String arrayNames[] = new String[]{"One", "Two"};
              session.setAttribute("arrayNames", arrayNames);
         %>
              <form action="?">
              <select name="select">
                   <c:forEach items='${ sessionScope.array}' var="row">
                        <c:choose>  
                             <c:when test="${param.select== row}"> >
                                  <option value="<c:out value='${row}'/>" selected><c:out value="${sessionScope.arrayNames[row-1]}"/></option>
                             </c:when>   
                             <c:otherwise>
                                  <option value="<c:out value='${row}'/>"><c:out value="${sessionScope.arrayNames[row-1]}"/></option>
                             </c:otherwise>
                        </c:choose>
                   </c:forEach>
              </select>
              <input type="submit" name="submit" value="submit"></input>
              </form>
         </body>
    </html>
    good luck.
    MatrixPooh
    www.bizdisplay.com

Maybe you are looking for

  • Safari hangs, does not load and crashes.

    I have read some of the posts regarding the newer version 4.0.2 of Safari but the answers were not helpful for me. I went into "Library" and "Application Support" and removed all the applications in that folder and placed them on the desktop. I reset

  • Need detailed manual showing how to install a pentium III motherboard on compaq armada m700

    I tried ti install a pentium III on my pentiumII compaq armada m700 It fails to power up. . I need detailed and complet directions with picturesshowing how to do this..additionally getting the screws out and in was near impossibe. Any suggestion ther

  • DMS attachment original name

    we are using ECC 5.0. During creation of DIR in DMS using cv01n we attach original files. However the actual name of these files is not display. Displaying of original file names of attachment is available in ECC6.0. How to get the same in ECC5.0? Cu

  • What is the situation with the Ruby bindings for QT and KDE?

    The 'kdebindings' package in extra contains only Python bindings. The 'ruby-qt' package in community conflicts with 'kdebindings' and is out of date. The 'ruby-qt4' package on the AUR conflicts with 'kdebindings', is out of date, and fails to build.

  • My installation fails mid way on CS2 photoshop on mac.

    Hello, I'm trying to install the CS2 on mac, It starts installing, though mid way it says: 'The installation failed, Installer encountered an error that caused the installation to fail. Contact the softaware manufacturer fo assistence' I have managed