Prelude and coda with JSP documents

Hello.
I have problems with adding prelude and coda templates to JSP documents (XML-format JSP).
This is content of my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
     <display-name>simple</display-name>
     <jsp-config>
          <jsp-property-group>
               <display-name>simple</display-name>
               <url-pattern>*.jsp</url-pattern>
               <el-ignored>false</el-ignored>
               <scripting-invalid>false</scripting-invalid>
               <is-xml>true</is-xml>
               <include-prelude>/prelude.jspx</include-prelude>
               <include-coda>/coda.jspx</include-coda>
          </jsp-property-group>
     </jsp-config>
</web-app>This is from prelude.jspx:
<?xml version="1.0" ?>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page">
     <jsp:directive.page contentType="text/html"/>
     <html xmlns="http://www.w3.org/1999/xhtml">This is coda.jspx:
     </html>
</jsp:root>And this is simple index.jsp of my web application:
<head>
     <title>Simple</title>
</head>
<body>
     <h2>Simple</h2>
</body>When running this on Tomcat 5.0.24 for Windows (Windows 2000 SP4) I get following exception on first request
org.apache.jasper.JasperException: /prelude.jspx(4,45) XML document structures must start and end within the same entity.Anyone have idea why is this happening ? How to include prelude and coda without breaking XML structure ?
Thanks, Nedim

The problem with what you are trying to do is that include will inlcude the response and not the original document.
In other words the jsp engine will try to compile prelude into a servlet, but because your xml document is not valid this would fail. Hence the XML error.
Do you absolutely need to use the xml syntax? Because jsp page syntax would work in this situation.

Similar Messages

  • Problems with JSP Documents (XML Mode)

    Hi --
    Have been following the spec for JSP as XML documents because I want to produce JSPs using XSLT. Two problems which I've yet to find anything but workarounds for:
    1. (Most pressing) JSP Documents do not allow this <%= blah %>. This creates problems when I want to dynamically create an attribute value. The spec recommends this: 'value = "%=var%"', but I've tried this in Tomcat 4.1.12 and the expression gets reproduced literally at run-time. I've searched these forums and not found an answer.
    2. Transformer wigs out on colons in "jsp:root" or "c:out" because it signifies a namespace with which it is unfamiliar. It doesn't need to recognize the namespace. Right now I'm putting in placeholders (jsp999root, for example) and replacing them after processing. Is there a better way?
    These problems are really getting in the way. Any help would be most appreciated.

    Have been following the spec for JSP as XML documents because I want to
    produce JSPs using XSLT. Two problems which I've yet to find anything but
    workarounds for:
    1. (Most pressing) JSP Documents do not allow this <%= blah %>. This creates
    problems when I want to dynamically create an attribute value. The spec
    recommends this: 'value = "%=var%"', but I've tried this in Tomcat 4.1.12 and
    the expression gets reproduced literally at run-time. I've searched these
    forums and not found an answer. I am stuck on this also and desperately searching for an answer. Has anyone found anything yet?
    2. Transformer wigs out on colons in "jsp:root" or "c:out" because it
    signifies a namespace with which it is unfamiliar. It doesn't need to
    recognize the namespace. Right now I'm putting in placeholders (jsp999root,
    for example) and replacing them after processing. Is there a better way?You can (and should) put multiple namespace declarations in the xsl:stylesheet tag. that will let it know about jsp:* and pass it through appropriately. Try something like:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:jsp="http://java.sun.com/JSP/Page">

  • Submit a document for approval and accompany with supporting documents

    Frequently, the document that is being submitted for approval, requires to be accompanied by supporting documents which may be Excel spreadsheets and/or Word documents and/or Autocad Drawings and/or PDF documents.
    How can I route these supporting documents along with the document being processed for approval?
    Thank you very much for your guidance.

    Do you have Sharepoint Standard License?
    I think what you need is start working with Document Sets. You can create workflow to Documents sets that treat multiple documents as if it's an archive. 
    http://blogs.technet.com/b/vedant/archive/2010/04/21/using-the-document-set-feature-in-sharepoint-2010-part-1.aspx

  • Enumerating Folders and Files with JSP

    Coming from the ASP world, I am wondering if there is a JSP equivalent to the ASP FileSystemObject for enumerating folders and files.
    Thanks in advance for the help.

    U can make use of File class of java.io for this..
    regards
    Shanu

  • JSP Documents (JSP pages in XML format) and Namespaces

    I have 1 set of XSLT stylesheets that takes XML and outputs JSP documents.
    This 1 set of XSLT supports numerous clients (customers).
    I have a new customer that uses a new namespace, let's call it "xyz".
    This namespace is the TLD for xyz custom tags.
    So, it would look something like this in the resulting jsp:root tag --> xmlns:xyz = "/xyzTagLib".
    Where /xyzTagLib has a corresponding entry in web.xml that points to the xyz.tld that is delivered in WEB-INF/TLD.
    However, most customers do not have the xyz application installed.
    Thus, I added the exclude-namespace-prefixes="xyz" in the xsl:stylesheet tag to conditionally add the xmlns:xyz only if an xyz tag exists. However, this does not add it to the jsp:root tag, but only to each individual xyz tag in the resulting document.
    However, the resulting JSP does not work in the runtime environment because it does not recognize the xyz tags.
    Is there a known bug with jsp documents declaring namespaces "in line" instead of at the jsp:root level? Is there a way around this?
    Thanks,
    Brian

    Hi Tridib,
    the XML content is stored in the .xml file. You'll have to access it in a way that doesn't cause the XML-to-HTML transformation to take a peek at the format. You could probably do this by accessing the repository in question via WebDAV. If you're on a later SP, you should be able to go to /irj/go/km/docs/ in your browser to access the repository via WebDAV. Otherwise, take a look in the details pane of the folder that contains the .xml file in question. Under properties, there'll be a URL to access the folder via WebDAV.

  • Please help; how to write XML document with JSP?

    I try to write XML document with JSP...
    But I got wrong results everytime.
    The result is not XML file displayed in the browser,
    but HTML file.
    I even tried to use HTML special code for <, >, "
    but still display as HTML file not XML file.
    How to do this?
    Thanks in advance. I put my codes below.
    Sincerely,
    Ted.
    ================
    Here is code for the JSP (called stk.jsp):
    <%@ page contentType="text/xml" %>
    <%@ page import="bean.Stock" %>
    <jsp:useBean id="portfolio" class="bean.Portfolio" />
    <% java.util.Iterator pfolio = portfolio.getPortfolio();
    Stock stock = null; %>
    <?xml version="1.0" encoding="UTF-8"?>
    <portfolio>
    <% while (pfolio.hasNext())
    stock = (Stock) pfolio.next(); %>
    <stock>
    <symbol>
    <%=stock.getSymbol() %>
    </symbol>
    <name><%=stock.getName() %> </name>
    <price><%=stock.getPrice() %> </price>
    </stock>
    <% } %>
    </portfolio>
    =================
    Here is the code for bean.Stock:
    package bean;
    public class Stock implements java.io.Serializable
    String symbol, name;
    float price;
    public Stock(String symbol, String name, float price)
    this.symbol = symbol;
    this.name = name;
    this.price = price;
    public String getSymbol()
    return symbol;
    public String getName()
    return name;
    public float getPrice()
    return price;
    ===============
    And here is bean.Portfolio:
    package bean;
    import java.util.Iterator;
    import java.util.Vector;
    public class Portfolio implements java.io.Serializable
    private Vector portfolio = new Vector();
    public Portfolio()
    portfolio.addElement(new Stock("SUNW", "Sun Microsystem", 34.5f));
    portfolio.addElement(new Stock("HWP", "Hewlett Packard", 15.15f));
    portfolio.addElement(new Stock("AMCC", "Applied Micro Circuit Corp.", 101.35f));
    public Iterator getPortfolio()
    return portfolio.iterator();
    }

    Hi
    I'm not sure whta your query is but I tested your code as it is has been pasted and it seems to work fine. There is an XML output that I'm getting.
    Keep me posted.
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems
    http://www.sun.com/developers/support

  • SQL query with JSP and WML-parameters

    Hey,
    Could you help me?
    I'm trying to do the following. WML deck card 1 send parameter to same WML deck's card help. I try to read the parameter with JSP in card help by putting the parameter to SQL query, but it doesn't work. I can read the parameter with WML in card help. I can also print the value of the parameter with JSP if I generate WML with JSP.
    /*parameter sending from card 1 to card help*/
    out.println("<go href='#helpcard'>");
    out.println("<setvar name='valittukurssi' value='$(valittukurssi)'/>");
    /*parameter read with WML in card help */
    <p>Valitse kurssi.
    $valittukurssi</p>
    /'parameter read with JSP by generating WML with JSP*/
    out.println("<p>$valittukurssi</p>");
    /* SQL query with JSP */
    ResultSet uudettulokset = uusilause.executeQuery("select * from kurssi where lyhenne='$valittukurssi'");
    Thanks,
    Rampe

    You're problem is easy to fix. You're confusing WML variables with JSP variables. See below:
    >
    /*parameter sending from card 1 to card help*/
    out.println("<go href='#helpcard'>");
    out.println("<setvar name='valittukurssi'
    value='$(valittukurssi)'/>");
    Above you set a var that will work on the phone, not in JSP.
    /*parameter read with WML in card help */
    <p>Valitse kurssi.
    $valittukurssi</p>
    Yes the above does display the parameter, because it is a client side WML var, but you cannot use this variable in the JSP code (that's why your SWL fails).
    /'parameter read with JSP by generating WML with
    JSP*/
    out.println("<p>$valittukurssi</p>");Here's you're problem, the above line is EXACTLY the same as the one before it. When the container parses through this JSP code it translates the above line to:
    <p>$valittukurssi</p> on the WML page and the CLIENT uses it's local variable to display it.
    What you need and want is to have a variable that can be used in JSP code and output to your WML page. Here's how it's done:
    out.println("<go href='#helpcard'>");
    String some_name = "valittukurssi";
    out.println("<setvar name='"+some_name+"'
    value='$("+some_name+")'/>");
    //note that you may have to escape the ( and ) with a \
    //so we displayed the variable above into the WML page, now we can use it in the SQL query:
    /* SQL query with JSP */
    ResultSet uudettulokset =
    uusilause.executeQuery("select * from kurssi where
    lyhenne='"+some_name+"'");//the end of the command is: " ' " ) ;
    Frank Krul
    Got Node?

  • JSP documents and namespaces

    I have an issue involving JSP documents (i.e. JSP pages that are
              well-formed XML documents). I am using namespaces on children elements
              of the <jsp:root> element, because my JSP page generates XML with
              namespaces. The simple fragment below illustrates this:
              <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
              version="1.2">
              <d:document xmlns:d="http://example.org/xml/document">
              <d:head>
              <d:title>Example</d:title>
              </d:head>
              <d:body>
              Some Text.
              </d:body>
              </d:document>
              </jsp:root>
              This example works with Tomcat 4 and Tomcat 5, but fails with WL
              8.1. I get an error like this:
              /example/my.jsp(20): no corresponding open tag for tag extension
              close: //[ ; Line: 20]
              probably occurred due to an error in /example/my.jsp line 20:
              </d:document>
              This seems to be a bug in the WebLogic JSP implementation. It should
              be possible to generate XML documents containing namespaces. The JSP
              1.2 spec is actually silent on this, but it says (JSP.5.2.2):
              "the root is where namespace attributes of taglibs will be inserted.
              All tag libraries used within the JSP document are represented in the
              root element through additional xmlns attributes."
              This to me implies that namespace declarations occurring elsewhere in
              the document are not interpreted as tag libs and therefore should be
              handled like regular tags.
              Any help is appreciated.
              -Erik
              

              "Erik Bruchez" <[email protected]> wrote in message
              news:[email protected]...
              > Thanks Nagesh,
              >
              > In passing, looking at the latest JSP 2.0 spec, I found out that there
              > may be an additional issue in the future, as the 2.0 spec allows for
              > tag libraries namespace declarations everywhere in the document. How
              > are you going to be able to generate XML documents with namespaces if
              > every namespace is necessarily bound to a tag library? The spec does
              > not seem to address this at all. I have emailed my feedback to the
              > JSR, but it would be interesting to have the opinion of WebLogic
              > developers on this.
              >
              > -Erik
              As far as i can remember, this doesn't restrict the namespaces in themselves
              i.e not attached to any taglibs. Given a namespace which is not resolved as
              a taglib, it will be considered a standard namespace no? .. Am i missing
              something. Also which section and which PFD version of the spec are you
              looking at? It would be great if you can give a little more detail about the
              issue so it can be fixed in the spec if possible..
              I would also be interested in knowing how you are using the Jsp documents
              (in xml format) in general. (since I'm trying to get an insight into the
              various ways in which jsp Docs are being used by customers)
              Nagesh
              >
              > Nagesh Susarla <[email protected]> wrote in message
              news:<[email protected]>...
              > > Hi Erik,
              > >
              > > Indeed this does look like a bug in the wls jsp container. Attributes
              > > with ':' in them are not being lexed correctly. I've opened CR111972 to
              > > track this issue, so please contact [email protected] for necessary
              patches.
              > >
              > > thanks
              > > Nagesh
              > >
              > > Erik Bruchez wrote:
              > > > I have an issue involving JSP documents (i.e. JSP pages that are
              > > > well-formed XML documents). I am using namespaces on children elements
              > > > of the <jsp:root> element, because my JSP page generates XML with
              > > > namespaces. The simple fragment below illustrates this:
              > > >
              > > > <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
              > > > version="1.2">
              > > > <d:document xmlns:d="http://example.org/xml/document">
              > > > <d:head>
              > > > <d:title>Example</d:title>
              > > > </d:head>
              > > > <d:body>
              > > > Some Text.
              > > > </d:body>
              > > > </d:document>
              > > > </jsp:root>
              > > >
              > > > This example works with Tomcat 4 and Tomcat 5, but fails with WL
              > > > 8.1. I get an error like this:
              > > >
              > > > /example/my.jsp(20): no corresponding open tag for tag extension
              > > > close: //[ ; Line: 20]
              > > > probably occurred due to an error in /example/my.jsp line 20:
              > > > </d:document>
              > > >
              > > > This seems to be a bug in the WebLogic JSP implementation. It should
              > > > be possible to generate XML documents containing namespaces. The JSP
              > > > 1.2 spec is actually silent on this, but it says (JSP.5.2.2):
              > > >
              > > > "the root is where namespace attributes of taglibs will be inserted.
              > > > All tag libraries used within the JSP document are represented in the
              > > > root element through additional xmlns attributes."
              > > >
              > > > This to me implies that namespace declarations occurring elsewhere in
              > > > the document are not interpreted as tag libs and therefore should be
              > > > handled like regular tags.
              > > >
              > > > Any help is appreciated.
              > > >
              > > > -Erik
              

  • I just updated my Firefox browser to Firefox 8. I am a college student and practice with HTML and CSS for class assignments. The fonts in all my html documents are being overwritten online by your script typeface. How do I resolve this issue?

    I just updated my Firefox browser to Firefox 8. I am a college student and practice with HTML and CSS for class assignments. The fonts in all my html documents are being overwritten online by your script typeface. I did not have this issue in the older version. I use an iMAC running OS10.6.8. How do I resolve this issue?

    Starting with this, you have errors in your CSS code.
    body {
      margin-top: 0px;
      margin-right: 0px;
      margin-bottom: 0px;
      margin-left: 0px;
      color: 151515;
      font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
      background-color: EFF5F8;
    body {
      margin:0;
      color: #151515;
      font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
      background-color: #EFF5F8;
      font-size: 100%;
    Related links:
    Windows Chrome, why do my fonts look so bad? - Lee Green
    css3 - Bad font rendering Chrome - Stack Overflow
    Nancy O.

  • Creating UDO through code  with 1 Docment table & 4 Document Line Tables

    Hi,
    I need to create one Document table and four Document Line tables(child tables) and make them UDO through code. This process is working When I am creating UDO with one Document table and one Document Line table but if I add more than one Child table it is taking only one child.... Can anyone give me some solution or code example related to this problem this problem?
    Regards,
    Sudeshna.

    Hi,
    Firstly Trinidad, unfortunately I could not open that link.
    And secondly, the following is my code... Through this code I am trying to create an UDO with one document table and two document line tables.... here the UDO is being created but it is not taking two line table, its taking only one Document line table.... how can I create udo with more than one Document line tables?
    Dim oUserObjectMD As SAPbobsCOM.UserObjectsMD
    oUserObjectMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
    oUserObjectMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.CanClose = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.CanFind = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.CanLog = SAPbobsCOM.BoYesNoEnum.tNO
    oUserObjectMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.ChildTables.TableName = "childSplitNew1"
    oUserObjectMD.ChildTables.TableName = "childSplitNew2"
    oUserObjectMD.Code = "udoSplitNew"
    oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tNO
    oUserObjectMD.Name = "udoSplitNew"
    oUserObjectMD.ObjectType = SAPbobsCOM.BoUDOObjType.boud_Document
    oUserObjectMD.TableName = "masterSplitNew"
    lRetCode = oUserObjectMD.Add()
    Regards,
    Sudeshna.

  • Memory leak with jsp and beans

    The application we have created has one particular page that is designed to stay up in the browser and refresh with new information from database queries once every 60 seconds. Running with Tomcat3.2.1 and IE5.5
    The problem is that the memory usage of java.exe continues to grow until the machine crashes from out of memory. It does take more than 24 hours to crash.
    Things I have tried to do to track down the problem or eliminate the problem.
    - I have explicitly set the scope of the beans to "page"
    - I have watched the DatabaseAccess.class (the beans are all extended from this class) and put in code to watch how many instantiations of the class are made and subsequently garbage collected. This appears to be where the memory leak may reside - hundreds of instantiations from some other source than the page I am displaying.
    - the top frame makes database queries for security and display of a menu system dependant upon security clearance. It does not set any time for refresh (refresh == 0). Nor does it explicitly set a scope for the beans.
    - I have run a different jsp engine to see if this was directly related to Tomcat - same problem with resin2.0.0
    The main jsp page that is in the bottom section of the page has the following code:
    ** only the relevant lines are included here
    <%@ include file="../../common.jsp" %>
    <%
         refresh=60;
    %>
    <head>
    <%@ include file="../../meta_head.jsp" %>
    </head>
    <body bgcolor="#FFFFFF" text="#003399" link="#660099" vlink="#990099" alink="#006666" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <%@ include file="../../access.jsp" %>
    <%@ include file="../../page_title.jsp" %>
    <jsp:useBean id="Line" class="jsp.Line" scope="page" />
    <jsp:useBean id="Machine" class="jsp.Machine" scope="page"/>
    <jsp:useBean id="Alarm_log" class="jsp.Alarm_log" scope="page"/>
    contents of meta_head.jsp
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <META HTTP-EQUIV= "expires" content = "0">
    <META HTTP-EQUIV="Pragma" CONTENT="no_cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache" forua="true">
    <META NAME="robots" content="NOINDEX,NOFOLLOW">
    <%
    if (refresh > 0)
    %>
    <meta http-equiv="Refresh" content="<%= refresh %>">
    <%
    If anyone has some suggestions on how to trap this memory leak, it would be terrific. Or, some other things to try to stop the instantiation of the DatabaseAccess object (perhaps setting the scope of the beans in the header to "session" or "application"?).
    Thanks in advance.
    Roberta

    jsp:useBean tags scope declaration :
    page = Create a new instance on each load.
    session = Load instance from the session, if not there, create one
    application = Load instance from the ServletContext, if not there, create one.
    Not sure how you are populating the data variables, but make sure you are closing all ResultSet, (Prepared)Statement, and Connection objects.

  • How to generate html-code using csv input with JSP or JAVA???

    Hello,
    I want to read out a .csv-file and generate html-code dynmically with JSP in an EP6 Application. The problem is, that the csv-file can’t be located or openend.
    BTW if every knows a good tutorial or weblog for this, please post the link.
    It’s located in a par-archive under:
    />dist>files
    I tried various methods, in the doContent mehtod or with JSP. Everytime same result.
    Here part of the code I tried in the doContent():
    public class CSV extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
            String strWRoot = request.getWebResourcePath();
            String contentCSV="", line="";
            String linesep = System.getProperty("line.separator");
            File fileLoadCSV = new File(strWRoot+"/files/ma_infosysteme.csv");
            boolean exCSV = fileLoadCSV.exists();
            boolean reCSV = fileLoadCSV.canRead();
            int a=0;
            if(exCSV&&reCSV){
                response.write("ok");
                try {
                  BufferedReader inputCSV = new BufferedReader(new FileReader(fileLoadCSV));
                  while((line=inputCSV.readLine())!=null){
                    contentCSV=contentCSVlinelinesep;
                    a++;
                  inputCSV.close(); 
                catch(IOException ioex){
                    System.out.println("Fehler");  
            else {
                response.write("not ok");
            response.write("<br>Wroot: "+strWRoot);
            response.write("<br>File: "+fileLoadCSV);
            response.write("<br>exists: "+exCSV);
            response.write("<br>read: "+reCSV);
            response.write("<br>Input: "+contentCSV);
    The Output is:
    not ok
    Wroot: /irj/portalapps/DHTML
    File: \irj\portalapps\DHTML\files\ma_infosysteme.csv
    exists: false
    read: false
    Input:
    So thanks to everyone who can give me a good hint.
    Bye.

    Without really looking too much into this it looks like the problem is with the way in which you are trying to open the file. I believe that when creating a File object you need to use a physical path. By using the getWebResourcePath() method you are retrieving the URL to this file and not the physical path name. There is another method (can't remember the exact name) called getPublicResourcePath() (or something similar) which will return the physical path to this file, i.e. c:\usr\sap\.....etc. If you try it this way it may well work
    I hope this helps
    D

  • Standards in a web application with JSP and J2EE

    Hello!
    Can anyone to point me to a tutorial or an URL that contains standards for an web application with jsp(including tag libs), beans and servlets.
    Thanks
    Catalin

    on the left side of this page...there are links "Documenation", "Tutorials", "Code Samples", pick your choice...there are alot of tutorials, try some or try them all :)

  • Authentification and Security in WebApp with JSP

    Hello to all.
    I'm developing a Web Applications with JSP's. To use the application a user must first Login.
    To restrict access via URL typing I have included in every JSP page a user_logged_in_check page that verifies that the user is logged in, and if not redirects to the Login page.
    The problem is that I must not forget to include that page in all my JSPs, and if the name of the page changes, it must be changed everywhere (though a search/replace might do the job just fine).
    I used this approach because is not server dependent (such as the Tomcat Realms example I have seen on this forum).
    Is there a better strategy?
    Is there a way to enforce security check and not rely on my attention ;)?
    Is there a pattern that solves the problem?
    Any help would be greatly appreciated.

    The first and biggest disadvantage is the repetitive coding - what happens if you realise that you need to change something - you will need to modify each of your JSP files. The chances of someone forgetting to add it in are a security risk.
    Secondly, using the web server's mechanism, in most cases, would mean that you are using a proven and much more stable security mechanism then you can whip up.
    For example, in Weblogic, you can configure a JAAS provider -- that means you are not limited to using uname/password. Your customer may have an enterprise wide single sign on policy that is supported by the JAAS provider and you can use it straight away - by just making a declarative change in the web*.xml files.
    If you must, use the Filter class (its a Servlet class, I checked after I had posted) as described in the Intercepting Filter pattern - at least thats a standard approach and will cut down on you having to rely on adding a snip of code to each of your JSPs.

  • Write blobs to olite with VB and read/display with jsp

    How can I insert an image BLOB with Visual Basic into OLite 9i and afterwards read it again with JSP to display the image BLOB?

    Sure. There is even sample code for both VB and JSP in the Mobile SDK.
    ORACLE_HOME\Mobile\Sdk\Examples\BLOB Manager\SourceCode
    ORACLE_HOME\Mobile\Sdk\wtgsdk\src\sample6

Maybe you are looking for