JSP vs XSL

We are trying to decide whether to use JSPs or XML/XSL for the user
          interface for our application. It is a large-scale application - large
          online shopping site - and need to do all coding in 6 weeks. One question
          we have is whether it is more expedient ot use JSPs or XSL for the
          presentation. Is one or the other more difficult to pick up, etc.
          Dennis Pagano
          Noospherics Technologies Inc.
          

That depends on your talent pool. Remember that JSP are automatically compiled
          into servlets and can be used to produce XML instead of HTML. This XML can then
          be formatted before being sent to the client.
          JSP are for the most part easier to work with (in terms of compilation and
          deployment, not to mention a bunch of code that gets produced for you
          automatically).
          But, if you have some experienced servlet programmers who never used JSP, I
          would skip the learning curve to meet the deadline(tm).
          My 2c,
          Guy
          In weblogic.developer.interest.jsp Dennis Pagano <[email protected]> wrote:
          > True, but there are two ways to create the pages - one whereby a servlet
          > creates xml representation of data and applies xsl to create a page. The
          > other where I write a JSP and refer to beans of data. My question is which
          > is easier to pick up - faster to become productive, and more likely to
          > deliver results quickly.
          > Guy Tal <[email protected]> wrote in message
          > news:[email protected]...
          >> I think you're comparing apples and oranges. XSL can be used to format XML
          >> data. JSP can be used to embed Java code in your HTML pages. They are not
          >> competing technologies.
          >>
          >> Guy
          >>
          >> In weblogic.developer.interest.jsp Dennis Pagano
          > <[email protected]> wrote:
          >> > We are trying to decide whether to use JSPs or XML/XSL for the user
          >> > interface for our application. It is a large-scale application - large
          >> > online shopping site - and need to do all coding in 6 weeks. One
          > question
          >> > we have is whether it is more expedient ot use JSPs or XSL for the
          >> > presentation. Is one or the other more difficult to pick up, etc.
          >>
          >> > Dennis Pagano
          >> > Noospherics Technologies Inc.
          >>
          >>
          

Similar Messages

  • Jsp & XML-XSL

    Hello.
    I have a device that produce XML output file( dynamically )
    I need to read it by Jsp page.
    I able to do it using XSL but when XML changes my Jsp page is not updated.
    Only if i recompile jsp page i get new data
    Do you know some methods to get dynamically XLM data?
    Thx
    Riccardo
    example code:
    <%@page contentType="text/html"%>
    <html><head><title>XSLT Example</title>
    <%@ taglib uri='/WEB-INF/tlds/xslt.tld' prefix='xslt' %>
    </head>
    <body>
    <xslt:apply xsl='Fieldgate.xsl'>
         <%@ include file='output.xml' %>
    </xslt:apply>
    </body></html>

    Thats because you are including your XML in your JSP.
    If you were to parse your XML in your in your JSP using SAX or DOM and then use them to populate the dynamic contents of your JSP then you will not need to recomplie your JSP.
    Read the following article. It will help you out and possibly give you some other Ideas.
    http://developer.java.sun.com/developer/technicalArticles/xml/WebAppDev2/#code13

  • JSP(XML+XSL)=HTML : error: sealing violation

    Hi,
    I have this jsp which will transform an xml file to html using xsl file... but its giving me a sealing violation. i tried the same code in a java application and its working...
    The error thrown is this:
    Internal Servlet Error:
    javax.servlet.ServletException: sealing violation
    Root cause:
    java.lang.SecurityException: sealing violation
    <%@ page language="java" session="true" import="java.io.*,javax.xml.parsers.*,org.w3c.dom.*,javax.xml.transform.*,javax.xml.transform.stream.*" %>
    <%
    StreamSource xml = new StreamSource( new File( "C:\\Tomcat\\webapps\\pc\\logs\\TransactionLog.xml" ) );
    StreamSource xsl = new StreamSource( new File( "C:\\Tomcat\\webapps\\pc\\logs\\TransactionLog.xsl" ) );
    StreamResult result = new StreamResult( out );
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer( xsl );
    transformer.setParameter( "recordsPerPage", "10" );
    transformer.setParameter( "pageNumber", request.getParameter( "pageNumber" ) );
    transformer.transform( xml, result ); // this is where the error is thrown...
    %>
    i hope somebody can help me with this...
    thanks,
    mitch

    Hi
    I think that It's because of some confilict between packages, try to set more priority for your jar files in tomcat.bat file as below :
    set cp=%CLASSPATH%
    set CLASSPATH=.
    set CLASSPATH=%TOMCAT_HOME%\classes
    set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
    set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
    set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar
    set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
    set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
    if "%cp%" == "" goto next
    set CLASSPATH=%cp%;%CLASSPATH%
    ALI

  • Deploy JSP, XSQL-XSL Application on OC4J or Apache?

    I have an application having JSPs and XSQL-XSL pages (not EJBs)
    for the internet.
    Which is the best deployment type?
    - Running both on OC4J (after installing XSQL),
    - Running both on Apache,
    - Running one on Apache and other on OC4J?
    What about using Apache as a proxy sending requests to OC4J?
    Thanks.

    I deployed both on Apache (JSP,XSQL) and I have another PC with Apache as Proxy.
    It works fine. I dont know the performance when many users try to connect.

  • XML having a JSP as XSL stylesheet ...

    Hi,
    In WLS 5.1 SP6, I have a XML which uses as XSL stylesheet a JSP served by WebLogic (<?xml/stylesheet href="style.jsp?order=3"?>
    It appears that, when I try to pass more than one parameter to my JSP (i.e. "style.jsp?order=3&value=1"), the XML page does not "recognize" it anymore ... I have to pack all my parameters in a single string, pass it to my JSP and then parse it, which is quite ugly. Has somebody an explanation for this ? Thanks

    Perhaps you need to encode the '&' in the stylesheet processing instruction.
    <?xml/stylesheet href="style.jsp?order=3&value=1"?>
    "Stephane Jantzen" <[email protected]> wrote in message
    news:3a6ff593$[email protected]..
    >
    Hi,
    In WLS 5.1 SP6, I have a XML which uses as XSL stylesheet a JSP served byWebLogic (<?xml/stylesheet href="style.jsp?order=3"?>
    >
    It appears that, when I try to pass more than one parameter to my JSP(i.e. "style.jsp?order=3&value=1"), the XML page does not "recognize" it
    anymore ... I have to pack all my parameters in a single string, pass it to
    my JSP and then parse it, which is quite ugly. Has somebody an explanation
    for this ? Thanks
    >

  • Passing variables from JSP to XSL

    Hi;
    I need to pass some variables with string value in them to an xsl page to store them in a <param..> tag... ive so far been unsuccessful at that, the following are my codes.. : Does anyone know how to pass it directly into the xsl page ?...
    jsp page :
    <%
                                                                     String compNames;
                                                                     String[] listRight;
                                                                     compNames = (String)session.getAttribute("compNames");
                                                                     listRight = request.getParameterValues("listRight");
                                                                                         String yr1 = listRight[0];
                                                                                         String yr2 = listRight[1];
                                                                                         String yr3 = listRight[2];
                                                                                         String yr4 = listRight[3];
                                                                                         String yr5 = listRight[4];
                                                                                         pageContext.setAttribute("yr1", yr1);
                                                                                         pageContext.setAttribute("yr2", yr2);
                                                                                         pageContext.setAttribute("yr3", yr3);
                                                                                         pageContext.setAttribute("yr4", yr4);
                                                                                         pageContext.setAttribute("yr5", yr5);
                                                                                         pageContext.setAttribute("compN", compNames);
                                                                     %>
    xsl page :
    <xsl:param name="CoCode"><core:param name="compN" value="${compN}"/></xsl:param>
         <xsl:param name="yr1"><core:param name="yr1" value="${yr1}"/></xsl:param>
         <xsl:param name="yr2"><core:param name="yr2" value="${yr2}"/></xsl:param>
         <xsl:param name="yr3"><core:param name="yr3" value="${yr3}"/></xsl:param>
         <xsl:param name="yr4"><core:param name="yr4" value="${yr4}"/></xsl:param>
         <xsl:param name="yr5"><core:param name="yr5" value="${yr5}"/></xsl:param>

    and to display the xsl, ive used to following Include code :
    <jsp:include page ="./ratios.xsl"></jsp:include>
    i dont need to link it together with as xml as ive already done so in ratios.xsl file... i think there might be some mistake in using the include code... can anyone point out to me if im wrong... thanks

  • JSP and XSL Processor - How do you send the processed file to a JSPWriter?

    The hierarchy for the relevant I/O classes is:
    Object---OutputStream
    Object---Writer---PrintWriter
    Object---Writer---JspWriter
    For the processed file from the Oracle XSLProcessor, typically HTML, the XSLProcessor API v2.0.2.9 offers either 'OutputStream' or 'PrintWriter' as targets.
    Unfortunately, a 'PrintWriter' cannot be used as a 'JspWriter'.
    I realise that I can call
    HttpServletResponse.getOutputStream()/getWriter() but there may be problems using this with the 'out' object.
    According to the JSP documentation: 'Either getOutputStream() or getWriter() may be called to write the body, not both.'
    The XSLProcessor API does offer an 'XMLDocumentFragment' as another target so I can make an XML document from this but looking at the API for 'XMLDocument', this again only offers 'OutputStream', 'PrintDriver' or 'PrintWriter' as targets.
    Not sure if 'PrintDriver' helps.
    How do I send the output from the 'XSLProcessor' to a 'JspWriter'?
    Why does the API not offer a 'Writer' as a target?
    Polite observation - this would be consistent with the 'OutputStream' being offered and, if changed, would not break any existing code.
    null

    You can also use a PrintWriter to wrap a JspWriter
    since PrintWriter has a constructor that takes any
    Writer instance.I'm having the same problem, I've spent a lot of time
    on it but I can't get it work.
    Could you post some working code that shows how you
    can do it?
    Thanks.
    It works now, I have used the code:
    result = processor.processXSL(stylesheet, xml);
    PrintWriter pw = new PrintWriter(out);
    result.print(pw);
    I had tried this before but there was an error in other place that prevented it to work.
    Thank you anyway.

  • What to import in the JSP file??

    I want to use jsp and xsl to convert xml to html in order to display the file. But I come across a problem, I don't what should be import into the jsp file. Should I import these? <%@ page import="org.xml.sax.*" %>
    <%@ page import="org.apache.xalan.xslt.*" %>
    Since I'm not very good at this field, can anybody give me some suggestion to hlep me to work it out?
    thanks~

    One thing is sure. Whatever the classes you are going to use, need to be imported in your Jsp.
    There is no need for different import statements. You can write in a single import statement (comma separated).
    So, forget about the import statements and do your coding, finally you can look at the code and decide what classes (packages) you need to import.
    I think you need to import
    org.xml.sax.*;
    org.xml.sax.helpers.*;
    import javax.xml.parsers.*;
    Hope this helps.

  • Help whit dinamyc jsp events ^^

    Hello:
    hummmm! need help in create jsp (xml, xsl, xslt or whatever) whit dinamic html components events like checkbox, i.e:
    When i click in a checkbox or radio button, the action (event) must make me generate dinamyc html code like show fields or forms (not hide forms or tables, just generate tables or forms whit the checkbox or radio button actions). But i wan�t use javascript just JSP, XML, XSL or whatever.
    Please give me help =P plz

    You can use AJAX for doing this. Or you can submit the page onchange event of the combo and get the required values from the DB and set the values in the text field.
    Please check the onchange attribute of the select tag.

  • Xml/html to jsp - problem with quotes in attribute values

    I am trying to convert a static html document into a jsp using an xsl stylesheet, but run into problems trying to use the jsp expression syntax inside of attribute values.
    Here is a sample of the source file:
    <input type="text" name="firstName" value=""/>
    Here is what I want the resulting jsp file to look like:
    <input type="text" name="firstName" value="<jsp:expression>customer.getField("firstName") </jsp:expression>">
    Here is what part of my stylesheet looks like:
    <xsl:template match="input">
    <xsl:copy>
    <xsl:copy-of select="@type"/>
    <xsl:copy-of select="@name"/>
    <xsl:attribute name="value">
    <xsl:text disable-output-escaping="yes"><jsp:expression></xsl:text>
    <xsl:text disable-output-escaping="yes">customer.getField(</xsl:text>
    <xsl:text disable-output-escaping="yes">"</xsl:text>
    <xsl:value-of select="@name"/> ")
    <xsl:text disable-output-escaping="yes">")</xsl:text>
    <xsl:text disable-output-escaping="yes"></jsp:expression></xsl:text>
    </xsl:attribute>
    </xsl:copy>
    </xsl:template>
    The problem i have is with the <%= customer.getField("firstName") %>. I have tried several different ways of inserting the double quotes around firstName, but no matter what I try, it always uses the entity reference instead of actually putting the " character. The jsp container will not accept the entity.
    I am assuming that the problem is with trying to place double quotes inside of an attribute value. Any ideas how to get around this?
    Thanks
    David

    Which App Server are you using?
    You should just be able to escape the double quotes.
    If that doesn't work, it's a bug in the app-server.
    Alternatively, you can use single quotes around the
    attribute value.
    Hope that helps,
    AlexSorry, I'm an idiot. By escaping you meant the unicode character escape "\u0022". I had not tried that. However, once i realized what you meant, I tried it, and it worked. Thanks for your help.
    David

  • Merge all XSL files

    I am using XSL/JSP to design the Application Form.
    Now I want to split header, sidebar, footer and
    app form into 4 XSL files, only app form will receive dynamic data from XML, the rest are static pages.
    One way I can think of is using 5 JSPs to process
    E.g.
         ApplicationForm.jsp
         ->Header.jsp     -> Header.xsl
         ->sidebar.jsp     -> Sidebar.xsl
         ->Footer.jsp     -> Footer.xsl
         ->Form.jsp     -> Form.xsl
    But this method may be very expensive as each JSP has to invokes XSLTProcessor.process()
    How can I process these XSL files better in term of performance?
    Can I merge all XSL files into one first?
    Albert KT Tan

    Hello,
    I'm not exactly sure I get what you're looking for.
    What I was suggesting was one jsp calling a Java Class 5 times and outputting the XML string translated to HTML in their proper places.
    You're going to have 5 input xml files, so no matter what you're going to have to do 5 translations, right? If so what's the difference if you pass the same xsl to each translation or 5 different ones? Is this the part I'm confused on?
    You could do it like this too.
    <%
    //The class that does the translations
    ApplyXML ax = new ApplyXML();
    String header = ax.apply(xmlFilePathHeader, xslFilePathHeader);
    String sidebar = ax.apply(xmlFilePathSidebar, xslFilePathSidebar);
    String footer = ax.apply(xmlFilePathFooter, xslFilePathFooter);
    String form = ax.apply(xmlFilePathForm, xslFilePathForm);
    %>
    <!-- then just plug the translated strings in where you need them. -->
    <html>
    <body>
    <table>
    <tr>
    <td colspan="2">
    <% out.println(header); %>
    </td>
    </tr>
    <tr>
    <td>
    <% out.println(sidebar); %>
    </td>
    <td>
    <% out.println(form); %>
    </td>
    </tr>
    <tr>
    <td>
    <% out.println(footer); %>
    </td>
    </tr>
    </table>
    </body>
    </html>
    Am I still misunderstanding?
    -Mike

  • How to generate PDF output from OracleXMLQuery

    I want to generate a PDF out put from XML by using JSP. For this i writen jsp and xsl. My jsp code works fine if i include html formated xsl and it displays as a text when i pass pdf formated xls.
    Here i am providing my jsp code.
    I don't want to use XSQL, please provide me information ASAP.
    <%@ page import = "java.sql.*,oracle.xml.sql.query.OracleXMLQuery" %>
    <% Connection conn = null;
    Statement stmt = null;
    ResultSet rset = null;
    String dbURL = "jdbc:oracle:thin:@localhost:1521:oracle9i";
    try{
         DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
         conn = DriverManager.getConnection(dbURL, "scott", "tiger");
         stmt = conn.createStatement ();
         rset = stmt.executeQuery ("SELECT * " +
                   "FROM scott.emp ORDER BY ename");
    OracleXMLQuery xq = new OracleXMLQuery(conn, rset); %>
    <% xq.setStyleSheet("emptablefo.xsl"); %>
    <%= xq.getXMLString() %>
    <% } catch (java.sql.SQLException e) {  %>
    SQL error: <%= e %>
    <% }
    finally {
    if (stmt != null) stmt.close();
    if (rset != null) rset.close();
    if (conn != null) conn.close();
    } %>
    Thanks,
    Ramana

    >
    if the report output format is xls this code is generating the pdf output
    >
    looks like pdf is default output in template definition in xml publisher resp
    so for r12 use FND_REQUEST.ADD_LAYOUT as example
    v_request_id   number;
    xml_layout boolean;
    xml_layout := FND_REQUEST.ADD_LAYOUT('XXCUSTOM','XXCONCNAME','en','00','EXCEL');
    v_request_id := fnd_request.submit_request(application => 'XXCUSTOM',
                                               program     => 'XXCONCNAME',
                                               description => NULL,
                                               start_time  => NULL,
                                               sub_request => FALSE,
                                               argument1   => p_date
                                               );also see http://andyblg.wordpress.com/2012/08/23/run-concurrent-program-twice-with-different-layout-r12/

  • Problem in IAS Server with generation of PDF with FOP and XML parsing

    Dear co.forumers :
    We are developing an application that generates a pdf document with FOP Apache utilities, and this PDf is stored in a folder of the server. Firts of all, a DDBB data is retrieved using java ( jdbc) middleware classes ( servlets ), and with these data, the pdf is generated using FOP. In these process, he data retrieved from the DDBB is converted in a XML file , and the with the XSL FOP utility, the pdf is generated.
    In the other hand, we have another application that consults data from a java beans, using a JSP, generates a XML with the data of the beans, and with this XML, and with a XSL file generates and html , with the data and fixed text.
    Both applications have been deployed as a separated WebApp in the IAS. Both use Xalan as XML parser amb Xerces is used aswell.
    So, the problem is , after generating a pdf with the firts application, every html generated via JSP-XML-XSL transformation in the second application is shown completelly bad formated. All fixed text are wrongly composed, and the text that should appear in textFields and ComboBoxes is also bad formated. The XML with the data is well generated, so the problem is in the parsing of these XML and the conversion in html through XSL. We have to re-initiate the server and then everything goes well again. If no pdf is launched, no problem occurs with the other application.
    How an a WEB APP pplication can affect to another, installed both in different folders of the IAS ? We tried to change Xalan version and FOP version, but no result.
    Is this a Poltergeist ?? and X file , maybe ?
    Has anyone had the same problem ?
    Pleae, any help will be very wellcomed.

    A PDF document may be generated in the JDeveloper OC4J server.
    http://www.oracle.com/technology/pub/notes/technote_vohra_fop.html

  • Cannot find file resource

    Hi,
    this question might seem very trivial and you think that I should find it by searching on the internet but as often: you never find exactly what you want when you really need it.
    So, here is my question:
    I have a dynamic web project in eclipse and in my jsp a xsl file has to be loaded. I copied the file under the WebContent folder and within my jsp I tried the following:
    if(new File("transformation.xsl").exists())
      out.println("<h1>exists</h1>");
    else
      out.println("<h1>file does not exist</h1>");but everytime the file is not found. I dont know how to fix it - of course I tried some path combinations but it did not work.
    Thanks for answers in advance!
    Edited by: Cinimood on Sep 29, 2008 8:12 AM

    Cinimood wrote:
    new File("transformation.xsl")
    Do you realize that this will look for the file in the current working directory? There is no absolute thumb rule where exactly it is. You should also never rely on the operating system's or application server's configuration of the working directory. The file system operates completely independent from the web application. If you're interested though, just call File#getPath() to see what its absolute path is after all.
    There are two general approaches to access (external) file resources inside a web application, independent of where it is installed.
    1) Use ServletContext#getRealPath(). Place the resource somewhere in the webcontent. E.g. in the /WEB-INF. Then pass its path as a relative web path to ServletContext#getRealPath() to convert it to an absolute file system level path. Finally use it in File().
    2) Use ClassLoader#getResource(). Place the resource somewhere in the classpath or add its path to the classpath. Then use ClassLoader#getResource() to get its absolute URL. Finally use it in File(). Or just check if it is null or not. If you actually need an InputStream of it after all, then you can also just use ClassLoader#getResourceAsStream().

  • Good servlet design?

    Hi!
    I've been using Servlets for a little while now, but I'm not sure if I use them correctly.
    I usually write rather small servlets, like reading something from a database, and then putting that data into a table. Then I use the jsp:include tag to include 3-4 servlets in one jsp. I like this approach rather than tag libs in jsp (not quite the same but still..).
    Is this a bad way to use servlets?
    regards,
    Vidar

    Opinions on what is a good design are like opinions, everyone has one.
    My thoughts are basically have one servlet per page. Have the servlet do all the 'server side' work (database, ejb and other calls). Once done, forward to something that will 'draw' the page (JSP, XML/XSL). This way if you want to change the look, you only change the HTML in the JSP/XSL template.
    Basically, pick what works best for you. I would suggest learning the Serlvet/JSP APIs though. Many times I've seen people get totally thrilled over a feature in some other API (STRUTS) that is provided by the Servlet API. Since all Web Servers MUST follow the Servlet API, I would suggest learning it as your code will always work and be very portable.

Maybe you are looking for

  • What is Retro active rebates and how there are configured

    Hi, What it means by retro active rebates and how there are configured. Please also explain how rebates settlement will happen... Regards Sankar

  • I am unable to connect my new LaserJet CP1525nw to the wireless

    I already have 2 other HP printers and I only had to type the IP info and they are connected. my IPs are wierd, my printer and computer IPs are xxx.xxx.1.xx and my Gateway IP is xxx.xxx.0.1 and now when I try to enter these info on the printer it wou

  • Generic sort algorithim multiple data types

    How would I create a method to sort any type of data type given. Would I have to overload the method and rewrite the algorithim for each data type. This seems redundant. Could I use an interface somehow. I am clueless. I know you can do this in c++ u

  • Broken by Itself DCs

    Hi, After import the SAP_ESS to Development, I noticed that in the Buildspaces JDI_ESSTrack_D, there are 103 "Broken by Itself DCs" . These DCs have Compile State in "Red". An example of this DC is ess/ar/addr/cfg. Can you help to explain: 1. What is

  • I was wondering if I can use a Verizon iPhone 4S with AT

    I was wondering if I can use a Verizon iPhone 4S with AT&T