Advanced JavaServer Pages - JSP Templates

Great book but example template code not working..
I am having trouble getting the template example6.jsp working with the code supplied with the book. The code seems to be buggy when attempting to nest regions within regions.
Has anybody else had this problem ?
Problem as below
javax.servlet.jsp.JspException: regions can be created from a template or another region,but not both at
tags.regions.RegionDefinitionTag.doStartTag(RegionDefinitionTag.java:18)
at /example6.jsp._jspService(/example6.jsp.java:89) (JSP page line 5)

Book source can be downloaded at
http://www.phptr.com/advjsp/
the source is contained within a jar, the location within the jar is as follows
\booksource\4\regions_examples\
Example6.jsp and Example7.jsp, which contain nested regions, are the two examples which are not working correctly.
There is also a pdf download of the Templates Chapter 4 on the web page. Well worth a read.
Thanks for any help.

Similar Messages

  • Advanced JavaServer Pages

    I am trying to run David Geary's Advanced JavaServer Pages book.
    I have problems with running the "database:query" jsp tag in Chapter 10: Databases.
    I do not know why the query can not pass from QueryTag.class to Query.class. Here is the error that I got:
    javax.servlet.jsp.JspException: Query query-customers not found. Please retry the query
         at beans.jdbc.Query.findQuery(Query.java:54)
         at tags.jdbc.ReleaseTag.doEndTag(ReleaseTag.java:18)
         at org.apache.jsp.showCustomerQuery$jsp._jspService(showCustomerQuery$jsp.java:211)
    Any one have tried this?
    Thanks a lot!

    I am having the exact problem. Did you find a solution?

  • Oracle 9i Lite and JavaServer Pages (JSP)

    Hello,
    I was refered to this forum as I have a couple of questions:
    1. If I have an application built on JSPs and Servlets that runs against Oracle 9i and Oracle 9ias, Could I run the same application on Oracle Lite without making any changes to the application? if not, what are the changes I have to consider?
    2. I read that Oracle 8i is the database you use to make the tests, can I use Oracle 9i as well?
    3. I understood that J2EE is supported, do I need a special version/patch to be installed?
    Thanks.

    I also get the POL-3013 error message when trying to connect to the polite database as well as my own db. I can setup the user-dsn and run CREATEDB with no errors. I can even validate the db and no errors are reported. But I cannot use msql to connect to it. It used to work on my previous Win2k-machine with P4 cpu, but will not work with XP and Celeron.

  • JavaServer Pages (JSP) and JSTL

    Hi!
    I need to create a table where the user specifies only the td of the table. I do not know the size that the user will come but if he put 3 columns he needs to create these columns and then write the result
    thanks.

    Hi! I'm sorry
    I just forget to mention the problem,
    I am passing the following information to the TagLib.
    <mytag:table var="varItem" items="collVO">
    <mytag:colum print="Name" itens="${varItem.name}" with="100"></mytag:colum>
    <mytag:colum print="End" itens="${varItem.end}" with="100"></mytag:colum>
    <mytag:colum print="City" itens="${varItem.city}" with="100"></mytag:colum>
    </mytag:table>and I am getting this information again.
    private void getTable() throws JspException
    Object obterCollVoRequest = ExpressionEvaluatorManager.evaluate("collVo", getCollVO(), java.lang.String.class,this.pageContext);
    setCollVO(obterCollVoRequest.toString());
    Collection collectionCollVo = (Collection) pageContext.findAttribute(obterCollVoRequest.toString());
    setCollection(collectionCollVo);     
    }This problem is that he is coming null not know why this error, and I am not aware mounted the table with the above information (Remembering that is dynamic).
    Example:
    <table>
    <tr>
       <td>Nome</td>
       <td>End</td>
       <td>City</td>
    </tr>
    <tr>
       <td>Roger</td>
       <td>Street A Number 22</td>
       <td>New York</td>
    </tr>
    <tr>
       <td>Thomas</td>
       <td>Street Clich Number 199</td>
       <td>New York</td>
    </tr>
    </table>Thank you for your attention!
    Edited by: rdfcp on Oct 28, 2008 9:51 AM

  • Alternative to JSP templates

    [This is a cross post. I posted the same thing over at the coderanch: http://www.coderanch.com/t/554956/JSP/java/Alternative-JSP-templates]
    Hey,
    I've built and worked on quite a number of web applications using JSP for HTML templates.
    I always found that the templates would get quite messy and confusing even if you use JSTL instead of scriptlets.
    In a few projects I used other libraries for the HTML templates, Velocity for example.
    Though, that's just the same in a slightly different syntax. I've also worked with numerous other technologies in Ruby land,
    but I'm not happy with them either.
    To come to the point of this post: I don't like it very much and so I've created an alternative: Wandledi
    To describe it shortly: Instead of including scriptlets or custom tags into HTML files Wandledi uses a separate layer that's only responsible
    for transforming HTML markup in order to fill it with dynamic data and so on.
    For further information please have a look at http://wandledi.org *.
    The idea isn't entirely new, though I don't know any other library that implements it in this way and not only for Java,
    but for Scala, too.
    The reason I post this here is that I was hoping to get some feedback from Java (and possibly Scala) developers on the whole thing.
    Do you find the idea totally ludicrous or do you think it could make sense?
    I for one am actually using Wandledi in several projects and I like it very much.
    However, I might be a little biased. ;)
    Regards,
    Markus
    * For an actual Java example see: http://wandledi.org/spells/duplication.html
    Edited by: user5480329 on 06.10.2011 12:25
    Edited by: user5480329 on 06.10.2011 13:33

    First off: Thank you for your input.
    Please let me point out that Wandledi is in no way a web framework. It is a rather small library merely 'living in the presentation layer'.
    889994 wrote:
    +"The HTML markup stays clean and can even be edited with HTML editors such as Dreamweaver without getting confused.+" - This kind of argument is pretty widespread. Both ways. If there is some existing text editor for a given format they say - you may use editor XXX. If the format is too new they will tell - you do NOT need any special editor and sell that as an advantage. As of me I call that a "tools oriented approach" - as if starting a brand new technology we should first of all take a decision which editors it will comply to.
    In reality developing a technology as a whole (really new ideas included) costs non less than 50 times more than any editor. Editors must follow technology, not vice verse.I agree. This point I added because I thought of it as a little bonus.
    It's not something I had considered in the design of Wandledi. I use redcar for everything anyway! ;o
    889994 wrote:
    HTML files can be changed directly and the view is updated without recompilation. No compilation or runtime errors as a result of changes to templates - they may tell this. If is not a case they may tell something about how it is reliable when everything is compiled in advance.
    My 15 years of contact to JSP pages tells me that all end-up with including compilation of JSP as a step of a build. Otherwise you have a convenience of extra redeployments to production.Well, in the end the only thing that brings relative security are integration tests, I suppose.
    Cucumber to the rescue.
    Still the point of making recompilation unnessary is pretty valuable for development,
    because it makes it way quicker if you only make changes to the markup, which happens rather often
    when you're trying to circumvent another IE6 bug. ;)
    889994 wrote:
    "By putting the transformation logic into plain classes you can use the full power of the language (Java, Scala, ...) to describe the view transformations.
    This includes inheritance, composition and polymorphism to build up larger, more complex transformations OOP-style." - I have strong doubts that transformation logic is something needed for presentation. What about "the markup is also easier to read for humans, too."? - once you hide all under Java-coded transformations.This is a valid point. You can do all sorts of mischief with those transformations. But that's possible with any technology and it lies in the responsibility
    of the developer to be reasonable about it. It's important to point out that you usally do not want to generate HTML with Wandledi (referring to your print("<html>") statement). You merely transform. That is add, remove or change HTML attributes or duplicate portions of markup that is already there.
    One of the motivations behind Wandledi is that you should be able to express conditions and loops in an actual programming language instead of a cumcersome surrogate language or tags. The framework you suggested also makes this possible, which is good.
    To bring an example of Wandledi for loops.
    When you usally would do something like this:
    JSP:
    &lt;ul class="users"&gt;
      &lt;% for (String user : users) { %&gt;
        &lt;li&gt;&lt;%= user.name %&gt;&lt;/li&gt;
      &lt;% } %&gt;
    &lt;/ul&gt;I find this very ugly. The use of EL only improves the situation mildly.
    With Wandledi this would look like this:
    HTML:
    &lt;ul class="users"&gt;
      &lt;li&gt;Hans&lt;/li&gt;
    &lt;/ul&gt;
    Scala:get("ul.users li").foreachIn(users)( (li, user) => li.text = user.name )What I hope is that already in this small example the markup is more comfortable to read without the obfuscation through JSP. It is to me.
    Also it isn't more code, less even in this example. Just put into another file.
    Of course this would be less consise in Java. You would need about 5 lines of Java to express the same thing.
    889994 wrote:
    "The web designer can start building a functioning HTML page locally first without needing a server. Also they don't need to know jack about Java, JSP, JSTL, etc.." I agree. But. That may be said about ANY technology, including the JSP itself.That's not entirely true. What I mean is that the web designer can actually build the page locally and view it in his browser, simply by opening the file he is working on. Of course that is no longer possible once you start building stuff by including other files and so on.
    But you can build the components and simply view them in the browser. You can build concrete instances.
    Just as I did in the example above by inserting "Hans" instead of some variable name.
    You can show the page to anyone with a browser, no fragments. But mock content which will later get replaced with actual content.
    889994 wrote:
    One big piece missing in your proposal is about components and code reuse in general. That's the thing. It isn't. Because it is already there. You just do it the same way you would do it with your normal Java code.
    Because it is normal Java code.

  • How to Create a Page LOV Template and a Region LOV Report Template in APEX

    Hi All,
    Thanks in advance ..
    I am new to APEX , Currently working in APEX 3.2
    Can any one please guide me How to Create a Page LOV Template and a Region LOV Report Template in APEX
    So that I can create dynamic Multi column LOV in APEX
    Cheers
    Sachin

    Sachin,
    I think you are en-quiring about 'Custom pop-up page'. See this link. You will get all required info there.
    Regards,
    Hari

  • Most menu grayed out when using a Pages Newsletter template

    I selected a newsletter template (Design newsletter) and I'm working on it to create my own newsletter. I've been able to do some changes, but when trying to do add objects to the master (I want to have a watermark in each page), or insert page numbers, or a page break i can see that a lot of the menu items are grayed out. Is there something I'm missing? When i create a document from scratch all the menu is available. I even tried to copy all I had in the newsletter I'm creating and pasting to a new blank document, but then it looks complete messed up... Please give me a hand with this

    perazo
    *Page Layout* mode does not have master objects. Instead there is a template for each layout under the Pages menu on the toolbar.
    For watermarks you will have to position the graphic, change its transparency, send it to the back and lock it.
    Then:
    +Menu > Format > Advanced > Capture Pages…+
    Name the new page template which will then appear under the Pages menu on the toolbar. You will get a copy of that particular layout every time you select it from the menu. Think of it like a rubber stamp or Xerox copier, not a master anything.
    Retrospectively editing is a PITA as editing a page template does nothing to pages already using a template. The process of replacing a template, pointless as it is, is rendered even more absurd by the arcane method needed to do it. You have to type exactly the same name as the existing page template, including U&lc, without being able to view the name, then overwrite it.
    The mess continues as it asks whether you want to include more than the one page but all other options are greyed out. There are a string of features which don't work, half work or work badly with no explanation.
    It is confusing as *Page Layout* mode actually lacks exactly the kind of things that you would expect of most layout programs but the features still remain in the menus from *Word Processing* mode.
    It is the consequence of some very muddled thinking by Apple's programmers.
    Peter

  • Sams Teach Yourself Javaserver Pages in 24 Hours

    Hi.
    I'm a new user of Weblogic and I'm presently learning JSP. Like most people do
    I went out and bought a beginner's book on JSP.
    The book I bought is Sams Teach Yourself Javaserver Pages in 24 Hours by Jose
    Annunziato (DSc) and Stephanie Fesler Kaminaris.
    Up to now I've spent the 5 first hours trying to run my first JSP on Weblogic
    (seems like it's going to take more than 24 hours to complete the book!). The
    problem was simply a wrong path for the compileCommand variable in the weblogic.properties
    file.
    the authors suggest the following:
    compileCommand=c:/jdk1.2.2/javac.exe
    when it should be:
    compileCommand=c:/jdk1.2.2/bin/javac.exe
    The point I want to make is that this type of error is far too frequent in computer
    programming books, considering the prohibitive price they're sold at, and it shows
    a lack of respect on the part of the authors and/or publishers for the people
    who buy them. I encourage everyone to do like me and denounce these people on
    newsgroups all over the Internet. When their sales go down they will surely take
    action.
    On the positive side, I want to congratulate BEA for their newsgroups. This is
    how I finally got on the track to solving my problem. Otherwise, I probably would
    have spent at least 24 hours hacking around just to get that first JSP to work
    in Weblogic.
    Thanks.

    Hi.
    I'm a new user of Weblogic and I'm presently learning JSP. Like most people do
    I went out and bought a beginner's book on JSP.
    The book I bought is Sams Teach Yourself Javaserver Pages in 24 Hours by Jose
    Annunziato (DSc) and Stephanie Fesler Kaminaris.
    Up to now I've spent the 5 first hours trying to run my first JSP on Weblogic
    (seems like it's going to take more than 24 hours to complete the book!). The
    problem was simply a wrong path for the compileCommand variable in the weblogic.properties
    file.
    the authors suggest the following:
    compileCommand=c:/jdk1.2.2/javac.exe
    when it should be:
    compileCommand=c:/jdk1.2.2/bin/javac.exe
    The point I want to make is that this type of error is far too frequent in computer
    programming books, considering the prohibitive price they're sold at, and it shows
    a lack of respect on the part of the authors and/or publishers for the people
    who buy them. I encourage everyone to do like me and denounce these people on
    newsgroups all over the Internet. When their sales go down they will surely take
    action.
    On the positive side, I want to congratulate BEA for their newsgroups. This is
    how I finally got on the track to solving my problem. Otherwise, I probably would
    have spent at least 24 hours hacking around just to get that first JSP to work
    in Weblogic.
    Thanks.

  • Spawn page, PDF template in Adobe X

    Hi all, I am working on a PDF form where the user needs to be able to add more pages if they still have info to enter.  After researching this a bit, it seems the best way to go is to define the page as a PDF template, then copy that template to a new page when the user presses a button (using javascript). I am not a programmer at all, but I found this forum post: http://acrobatusers.com/forum/javascript/duplicate-current-page-5-times
    That gave me some code to work with, but the code doesn't work for me, even with the corrections and taking out the comments.  Any advice on how I can do this?? Thanks to anyone who responds.  Here is the code I am currently working with:
    function CopyPage(nPageNum, nTimes) {
       // create template from pagevar
       t = this.createTemplate({cName:"myTemplate", nPage: nPageNum });
       // hide
       templatet.hidden = true;
       // spawn nTimes pages from templatevar
       t = this.templates;
    var T = t[0];
       // get first templage
       for (var i =0; i < nTimes; i++)  {
          T.spawn({nPage: this.numPages, bRename: false, bOverlay: false });
       // remove the template
       this.removeTemplate({cName: 'myTemplate'});
       return;
    } // end CopyPage function 
    // code to call CopyPage functionCopyPage(5, 1);

    You cannot use the createTemplate method in a script that's attached to a button. You would have to create a folder level script, or better yet, make the page a template at design time so you don't need to do so at run time. If you know in advance that you want to possible create a new page, this is what you should do.
    Also, when spawning a new page with fields, you should set the bRename parameter to true. Otherwise, the values of the fields on the different pages will be the same, which is probably not what you want.
    Let's say that you made the page on which your button is a template, and gave it the name "myTemplate". A Mouse Up script that would add a single duplicate page after it would be:
    // Get a template object from an existing template
    var t = getTemplate("myTemplate");
    // Spawn the template on the page following this one, and rename the fields
    t.spawn({nPage: pageNum + 1, bRename: true, bOverlay: false});

  • Javaserver Page

    Hello all,
    I am working on creating a deployable proxy and client javaserver page to consume a web service. I have created a Netweaver Development component for my deployable proxy, I specified my WSDL file, built the proxy and deployed it. That all seemed to work fine. I checked the General User Output and did not find any error messages.
    The part that I'm stuck on right now is the Javaserver Page. I'm following the instructions from the 'Creating a Client JavaServer Page' section from the website:
    http://help.sap.com/saphelp_erp2005/helpdata/en/d6/f9bc3d52f39d33e10000000a11405a/frameset.htm
    I have created another Development Component for my web module project. I also created my jsp file without problems. The next part is the one that I'm stuck on. The instructions say 'Select the name of the project and choose Add Web Service Client API Library from the context menu'. When I right click on the name of my web module project, I don't see this option. The closest thing that I see to it is 'Add Reference to WS Proxy DC', and it is grayed out.
    I tried creating a different Web Module project that is not a Development Component. I created the jsp file for it. When I click on this project, I do see the 'Add Web Service Client API Library' option, but it is grayed out.
    Can anyone point me in the right direction here as to what I need to do?
    Thanks!
    -Stephen Spalding
    Web Developer
    Graybar

    Hi Stephan,
    What version are you using?
    I see your link is to documentation in the ERP section for information on consuming Web services. Perhaps this link might help you: http://help.sap.com/saphelp_nw04/helpdata/en/81/12703e5da3e946e10000000a114084/frameset.htm
    Hope this helps.
    Daniel

  • [ANN] JavaServer Pages, 3rd Edition (O'Reilly)

    I'm proud to announce that the 3rd Edition of my JavaServer Pages book
    is now available at Amazon.com, BarnesAndNoble.com and other online
    stores, as well as in most regular book stores.
    The 3rd edition covers all the great new features added in JSP 2.0 and
    JSTL 1.1, such as tag files (custom tags as JSP pages), the Expression
    Language, the new, simplified tag handler API, XML syntax enhancements,
    new configuration options, and a lot more.
    For more information, a sample chapter and the updated examples, please
    visit the book web site:
    http://www.thejspbook.com/
    Hans Bergsten

    Nice work, Hans. It's a tribute to you that you've hit a 3rd edition. I thought the earlier ones were very good. - MOD

  • Customization of Search JSP Template in Commerce Server

              Hi
              I am currently amending the search.jsp template provided by BEA in the wlcs/commerce
              folder within Commerce Server 3.5 and according to them, one could carry out searhes
              on virtually any fields within the table provided ie WLCS_PRODUCT.
              I am trying to restrict field searching to the WLCS_PRODUCT_KEYWORD table so that
              the primary keys would be used to do searches on the Product Catalog table.
              Does any one have a good idea on how to do this?
              

    The Javascript is returned inside the page, just as if it were a static
              .html file that you had put Javascript into. Thus it works entirely on the
              client. The client is unaware of whether a JSP engine put the page together
              or whether it is was just a static HTML file.
              Peace,
              Cameron Purdy
              Tangosol Inc.
              << Tangosol Server: How Weblogic applications are customized >>
              << Download now from http://www.tangosol.com/download.jsp >>
              "Bola Taylor" <[email protected]> wrote in message
              news:3b9dd5fc$[email protected]..
              >
              >
              > I am currently using BEA Commerce Server and written some JSPs to be used
              in the
              > application. I am trying to carry out some validation of some fields in my
              JSP
              > and thats how javascript came up.
              >
              > The question I have is that does the javascript that I want to put on the
              jsp
              > run on the server or on the client like a normal html page? The questiion
              sounds
              > basic but I am considering writing a class to carry out validation as the
              user
              > could turn off javascript on browser.
              >
              >
              >
              >
              

  • JSF JSP Template

    Hi all, I'm using JDev 10.1.3. I have been trying to create some templates for my web pages but cannot get to the wizard. The "JSF JSP Template" item is not available in the "New Gallery". Any help is appreciated.

    It would be very interesting to have a more clear status about templating technology that will be implemented in the adf faces next release :
    1) does the technology be based on tiles, jsp, other
    2) what enhancements oracle plan to developp in templating, do you plan to introduce protected an updateable region like asp.net, do you plan to permit inheritance (extension)
    This is very important for people planing to use this technology at an enterprise level to build current application in a compatible way (reducing migration when the technology will be available) ?

  • How to use custom aspx page as template for custom content type

    Hi,
    I have created custom content type and custom aspx page. I want to use aspx page as template for custom content type.
    Can anybody please let me know how to accomplish this?
    Any help would be appreciated.
    Thank you,
    AA.

    Check if you are looking for the below
    http://www.sharepointpals.com/post/How-to-Create-a-Page-Layout-(PageLayout)-with-ContentType-in-SharePoint-2013
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How can I expand the gutters in a document created with a Pages brochure template?

    How can  I expand the gutters/ space between panels on a document created with a Pages brochure template?

    You haven't said which.
    Each panel is usually just a locked object, unlock them and resize the boxes.
    Peter

Maybe you are looking for