Choice between html & jsp type files

Usually, while developing applications, there is a common header and footer for all pages.Such header and footer pages can either be saved as a jsp file or as a html file. If there are no dynamic contents in the header & footer file, then,is it advisable to save them as html pages and then use the <% @ include file="header.html" %>. Or is it advisable to have it as a jsp file and access it using the tag <jsp: include page="header.jsp">.

If you use the "<% @ include file="header.html" %>" method, all you are doing is copying source code during the pre-compile stage. Whether you title your page header.jsp or header.html, all of it gets dumped into the resulting JSP page, which then gets compiled into a servlet. So, with the include file method, it makes no difference.
The <jsp:include> method requires the response to temporarily go to the header.jsp servlet to get the text, and then it will merge it with the file's text before sending it out. This is probably slower than having it all done at precompile time. However, using the <jsp:include> allows you to program the code independently without worrying about the code mixing (for example, both the header and your main page can have variables with the same name on them since the servlets are run independently and their outputs are the only things that merge). In your case, however, this isn't an issue.

Similar Messages

  • Selecting html input type=file in web form does not open a file browser on ZTE Open

    While trying to files from ZTE Open, I browsed to a web page with a file upload form. When I selected the file input, the input behaved as a text input and the on screen keyboard appeared.

    We are working to make Firefox OS better. This feature is not currently available but will be available in future updates to the device.
    Thank you for contacting Mozilla Support.

  • Try get value in input type="file". Not is full path. It's bug?

    In html:
    <input type="file" id="path_image">
    In javascript:
    path_image = document.getElementById("path_image").value;
    Example:
    Select path: "/images/image.gif"
    This result:
    path_image = " image.gif"

    You cannot preset input values for input type="file" elements. It's prohibited by HTML specification. It's namely a security hole.
    Imagine that one developed a webpage with input type="file" pointing to c:/passwords.txt and added window.onload=form.submit(), what would happen if one opened such a webpage?
    That said, get rid of scriptlets and step over to taglibs/EL. This is 2009, not 1999.
    <input type="text" name="foo" value="${param.foo}" />

  • HTML form posting with input type="file"

    Hi,
    I am trying to create a servlet to accept POST requests sent from a form which has an input field of type="file".
    When I first tried I found that I was only recieving the filename of the file and not getting any contents.. I then found out that I needed enctype="multipart/form-data" in my html form tag.
    Now my servlet isn't picking up any of the form data plus the reader returned by HttpServletRequest.getReader() just throws an IOException whenever I use it..
    I have tried to google for how to get this working but I haven't found much. Any help would be appreciated.

    Thanks cool..
    I also found this after some late night googling..
    http://www.jguru.com/faq/view.jsp?EID=1045507
    I'm trying to not use one of these utility classes for now until I find out exactly how they get their data from the HttpServletRequest object..

  • In Firefox 3.6.16, for pdf files, I have a choice between using Preview or asking whether to save; what happened to the choice between Preview or save?

    I am running Firefox 3.6.16 on a Mac Air (OS X 10.6.7). When given a url ending in .pdf, it used to be that Firefox would offer a choice between running Preview on the pdf file or saving the file. Now you can set your preferences so that either you run Preview, always save, or always ask whether to save. Apparently there is no way to get it to ask you whether you want to run Preview, save the file, or cancel. Is there some way to restore the old behavior?

    Check the setting in Tools > Options > Applications
    See "Reset Download Actions" and "File handling in Firefox 3 and SeaMonkey 2":
    http://kb.mozillazine.org/File_types_and_download_actions

  • HTML tag input type="file"

    hello!
    i used the html tag <input type="file" name="fp"> to have a browse File in my html Page and succesfully gets the file,path and directory when i used fp.value on my windows but when i Load the Html file in Linux
    i only get the filename (excluding the Path)
    can someone tell how to get through this any solution ?
    nid yur help badly!
    Gud day!
    p.s. i used a javascript to get the pf.value.

    Here is a solution:
    Post your question on a relevant forum. These forums are for Java. Java is not Javascript. Javascript is not Java.

  • Mixing Html/JSP - Is it possible to retain value in "file" input field?

    I have a jsp page with the following snippet:
    <% String text1 = (String)session.getAttribute("text1");
    if(text1 == null) {
    text1 = " "; }
    //get more attributes here
    %>
    <form name="file" action="checkFields_images.jsp" method="post" enctype="multipart/form-data">
    <input type="text" size="15" name="text1" value="<% =text1 %>"><br>
    <input type="file" name="image1" />
    <br>
    <input type="text" size="15" name="text2">
    <br>
    <input type="submit" name="submit" value="submit">
    </form>
    ...upon submission, it will go to a jsp that will check the fields for blanks or errors. If there are errors, the page will forward the user BACK to the original page, and each field that had an entry will be displayed with what the user had entered.
    The way my code operates is when the user hits the submit button, the jsp page that checks the fields is also setting the values submitted in session attributes. Those of you familiar with JSP code will know what I mean.
    That way when the page is redisplayed the "value" attributes of each <input> field will be set to what the user entered by way of such:
    <input type="text" name="text1" value="<%=text1%>">
    where <%=text1%> is a java variable set to the session attribute value for this <input> field.
    Now I know that the <input type="file> field has a value attribute, but I don't believe it is something that can be set. So how do I workaround this? I just want the field to display the file name the user had selected. I've worked with mixing JavaScript and Java code, but there are certain things you can and can't do, and I'm coming up with any "can do's" for this one.
    Any suggestions are appreciated
    Thank You,
    Love2Java

    You are absolutely correct.
    For security reasons, you can't specify a value for the input type="file".
    Here is one suggestion, of how I would see it work in a perfect world.
    - The file is uploaded and retained on the server
    - You send back a page without an input type="file"
    - The user fixes whatever fields they got wrong and submits again
    - The server picks up the correct fields, along with the file sent with the "bad" request, and then continues as normal.
    In this way, you only have to upload the file once.
    Instead of regenerating the <input type="file">, it would generate something like "File already uploaded. Correct other fields"
    pros:
    - Don't have to worry about repopulating the input type="file"
    - user only uploads the file once
    cons:
    - if the user wants to change the file? Maybe another link?
    - must retain file on server somewhere, and find it later.
    I didn't say it was easy, but it seems the most sensible approach to me.
    Cheers,
    evnafets

  • HTML DON'T WORK!!!!!!!!    input type="file" /        !!!!!!!!!!!!! THAT??

    HTML DON'T WORK!!!!!!!! <input type="file" /> !!!!!!!!!!!!! THAT??
    Ipad, ipod touch, iPhone
    Safari, opera...
    I don't add photo to site!!!!!!!!!!!!!!!

    What?
    It doesn't work where?
    you don't add what photo to what site?

  • How can i change the html, jsp, js, css file using ../tools/filemanager.jsp

    Hallo Experts
    I want to know how to get the html, jsp, js, css file using .../strategy/tools/filemanager.jsp? If I search the file such as "commentslist", I'll find the file. It is shown in the table with three columns:
    Column with trash symbol for deletion, Path and Date. But I cannot to fetch the file and saved local to make the modifications.  Could you tell me how I can get the file? Is there another way to this?
    Thanks a lot and
    Best regards!
    Ping

    Wang,
    If you are looking at the commentslist file with the intention of customizing, you would use File Manager Path to be directed to the file's location:
    \usr\sap\<3 letter CE instance>\J00\j2ee\cluster\apps\sap.com\xappscpmsm~strategymanagement\servlet_jsp\strategy\root\pilotworks
    Any customization would have to be noted, since upgrades will overwrite customizations.
    Regards,
    Bob

  • JSP, downloading files and show html page

    I like to download files and show a html page on JSP.
    With the source following, downloading works well.
    But, it is just remained on the previous page, not showing the next html page.
    Someone tell me why is it?
    <%@ page import="java.io.*, java.net.URL"%><%
    String file_name = request.getParameter("file_name");
    File fileDir = new File(config.getServletContext().getRealPath("upload/"));
    File theFile = new File(fileDir, file_name);
    FileInputStream fin = new FileInputStream(theFile);
    response.setHeader("Content-Disposition","attachment; filename=\"" + theFile.getName()+"\"");
    response.setContentLength((int) theFile.length());
    BufferedInputStream bf = new BufferedInputStream(new FileInputStream(theFile), 8096);
    int i;
    while ((i=bf.read()) != -1)
    out.write(i);
    bf.close();
    out.close();
    %>
    <html>
    <head>
    <title>file download</title>
    </head>
    <body>
    <p align="center"> </p>
    <p align="center"><b><font face="Tahoma" color="#000000" size="2">You have
    successfully downloaded your file(<%=file_name%>)!</font></b></p>
    </body>
    </html>

    You's already close the JSP output stream befor you try and write your html confirmation, and I don't think browsers can provide the kind of functionality you're trying to demonstrate here. A browser will download the file and open it directly itself or using another application based on user input (e.g. save as, open file, etc.). Once the file is opened or downloaded, it's done!
    I think your best bet is to show a dialogue that the user's download should begin, then set the pages href w/ JS to the location of the file, same way other sites that allow you to download files do it. Go take a look at download.com or something like that.
    Hope that helps.

  • How can I Sync a folder (which contains all types files, sub folders and weighs some gigs) through wifi or USB ( and not using cloud services) between my New Ipad and Win 7 PC? Any apps available? Kindly help

    How can I Sync a folder (which contains all types files, sub folders and weighs some gigs) through wifi or USB ( and not using cloud services) between my New Ipad and Win 7 PC? Any apps available?
    kindly suggest a solution.
    Thank you inadvance!

    You can only import photos/videos via USB and the camera connection kit.
    ITunes: Syncing media content to your iOS devices
    http://support.apple.com/kb/ht1351
     Cheers, Tom

  • XML, XSL - HTML(JSP), bad UTF-8 encoding on Tomcat

    I use simple transformation to create HTML (JSP) page from XML, XSL (both are encoded in UTF-8}. When doing this in embedded web server in JD9i developer, the result is fine. But when run at Tomcat 4.0.3, UTF-8 chars are displayed as 2 characters. It's interesting that the transformation gives different results:
    - in JD9i the UTF-8 chars are left unchanged and shown good in IE browser
    - in Tomcat the chars with acute (/) are transformed into "&iacute;" , "&aacute;" and so on and shown properly, whereas chars with caron (V) are encoded and shown badly.
    Does somebody know solution to this ? Thanks.

    Doing some more experiments reveals a subtle difference between GET and POST with Tomcat - it may apply to other application servers, but I have only tested with Tomcat 5 and Tomcat 6, so I can't say.
    The following is essentially what most people have indicated you need to do to have your JSP handle UTF-8:
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>My Title</title>
    </head>
    <body>
    </body>
    </html>This is what I couldn't get working with my GET (the default for forms) and ended up working when I specified the URIEncoding for the connector in the server.xml file.
    It turns out that the above will work with no modifications to the server.xml file if the form method is POST. If you need to be able use GETs then you will need to modify the connector, otherwise it would seem nothing you do at the JSP or servlet level will make a difference, unless you want to convert each parameter manually:
      String parameter = new String( request.getParameter("myParam").getBytes("ISO-8859-1"), "UTF-8" );Edited by: ajmasx on Sep 27, 2007 10:20 AM

  • Problem in getting the parameters from teh form html with upload file

    I have used the jspsmartupload package:
    the html file:
    <HTML>
    <BODY BGCOLOR="white">
    <H1>jspSmartUpload : Sample 5</H1>
    <HR>
    <form METHOD="POST" ACTION="sample5.jsp"
    NAME="PW" ENCTYPE="multipart/form-data">
    <table CELLSPACING="0" CELLPADDING="3" BORDER="1" WIDTH="474">
    <!-- FILE -->
    <!-- TEXT -->
    <tr>
    <td width="150">
    <div align="left">
    <p><small><font face="Verdana">Text :  </font></small>
    </div>
    </td>
    <td width="324"><small><font face="Verdana">
    <input TYPE="TEXT" name="myText" value="">
    <br>
    </font></small></td>
    </tr>
    <!-- TEXTAREA -->
    <tr>
    <td width="150">
    <div align="left">
    <p><small><font face="Verdana">Text Area :  </font></small>
    </div>
    </td>
    <td width="324"><small><font face="Verdana">
    <textarea name="myTextArea" rows="4" value=""></textarea>
    <br>
    </font></small></td>
    </tr>
    <!-- PASSWORD -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">PassWord :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <input TYPE="PASSWORD" name="myPASSWORD" value="">
    <br>
    </font></small></td>
    </tr>
    <!-- HIDDEN -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">Hidden :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <input TYPE="hidden" name="myHidden" value="hidden">
    <br>
    </font></small></td>
    </tr>
    <tr>
    <td><small><font face="Verdana">Select a first file : 
    </font></small></td>
    <td><small><font face="Verdana">
    <input type="file" name="FILE1">
    </font></small></td>
    </tr>
    <tr>
    <td><small><font face="Verdana">Select a second file : </font></small></td>
    <td><small><font face="Verdana">
    <input type="file" name="FILE2">
    </font></small></td>
    </tr>
    <!-- CHECKBOX -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">CheckBox :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <input TYPE="CHECKBOX" name="myCheckBox" value="Value 1">
    Value 1<br>
    <input TYPE="CHECKBOX" name="myCheckBox" value="Value 2">
    Value 2<br>
    <input TYPE="CHECKBOX" name="myCheckBox" value="Value 3">
    Value 3<br>
    </font></small></td>
    </tr>
    <!-- RADIO -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">Radio :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <input TYPE="radio" name="radio" value="Value 1">
    Value 1<br>
    <input TYPE="radio" name="radio" value="Value 2">
    Value 2<br>
    <input TYPE="radio" name="radio" value="Value 3">
    Value 3<br>
    </font></small></td>
    </tr>
    <!-- SELECT -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">Simple Select :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <SELECT name="mySimpleSelect" >
    <OPTION value="Value 1">Value 1</OPTION>
    <OPTION value="Value 2">Value 2</OPTION>
    <OPTION value="Value 3">Value 3</OPTION>
    </SELECT>
    <br>
    </font></small></td>
    </tr>
    <!-- SELECT MULTIPLE -->
    <tr>
    <td>
    <div align="left">
    <p><small><font face="Verdana">Multiple Select :  </font></small>
    </div>
    </td>
    <td><small><font face="Verdana">
    <SELECT multiple name="myMultSelect" >
    <OPTION value="Value 1">Value 1</OPTION>
    <OPTION value="Value 2">Value 2</OPTION>
    <OPTION value="Value 3">Value 3</OPTION>
    </SELECT>
    <br>
    </font></small></td>
    </tr>
    <!-- SUBMIT -->
    <tr>
    <td colspan="2" width="474">
    <div align="center">
    <center>
    <p><small><font face="Verdana">
    <input
    TYPE="Submit">
    </font></small>
    </center>
    </div>
    </td>
    </tr>
    </table>
    </form>
    </BODY>
    </HTML>
    the jsp file :
    <%@page language="java" import="com.jspsmart.upload.*"%>
    <%@page import="java.util.*"%>
    <jsp:useBean id="myUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
    <HTML>
    <BODY BGCOLOR="white">
    <H1>jspSmartUpload : Sample 5</H1>
    <HR>
    <%
         // Initialization
         myUpload.initialize(pageContext);
         // Upload
         myUpload.upload();          
         // Files
         out.println("<BR><STRONG>Display information about Files</STRONG><BR>");
         out.println("Number of files = " + myUpload.getFiles().getCount() + "<BR>");
         //out.println("Total size (bytes) = " + myUpload.getFiles().getSize() +"<BR>");
         for (int i=0;i<myUpload.getFiles().getCount();i++){
              out.print(myUpload.getFiles().getFile(i).getFieldName());
              if (!myUpload.getFiles().getFile(i).isMissing())
                   out.print(" = " + myUpload.getFiles().getFile(i).getFileName() + " (" + myUpload.getFiles().getFile(i).getSize() + ")");
                   myUpload.getFiles().getFile(i).saveAs("/upload/" + myUpload.getFiles().getFile(i).getFileName());
              else
                   out.print(" = vide");          
              out.println("<BR>");
         // Request
         out.println("<BR><BR><STRONG>Display information about Requests</STRONG><BR>");
         // Retreive Requests' names
         java.util.Enumeration e = myUpload.getRequest().getParameterNames();
         // Retreive parameters
         while (e.hasMoreElements()) {
              String key = (String)e.nextElement();
              String[] values = myUpload.getRequest().getParameterValues(key);               
              // Browse the current parameter values
              for(int i = 0; i < values.length; i++) {
              out.print(key + " = ");
              out.print(values[i] + "<BR>");
    %>
    </BODY>
    </HTML>
    The result shown is:
    jspSmartUpload : Sample 5
    Display information about Files
    Number of files = 2
    FILE1 = path.txt (240)
    FILE2 = WS_FTP.LOG (146)
    Display information about Requests
    radio = Value 2
    mySimpleSelect = Value 1
    myTextArea = test
    myPASSWORD =
    myMultSelect = Value 3
    myHidden = hidden
    myText = test
    myCheckBox = Value 1
    myCheckBox = Value 2
    myCheckBox = Value 3
    I would like to know if i want to get back the parameters from the form ,
    is that i must use Enumeration.
    Because i have tried request.getParameter() to get the value of radio button, textbox, checkbox and select menu, but it get the null values.
    Also, the function of Enumeration does not get the values of parameter in sequence as html form. e.g.In the html file, the first parameters should be textbox,but it displays the radio button's values first.
    How to solve the problem .
    Thanks

    This sounds like a bug in the smart upload code. I have used this stuff before, but it's probably an older version, so maybe they broke something. Enumerations aren't usually guaranteed to keep things in any particular order. I would say for now, make a method to take the enumeration and a param name to find the value. And write to the JSPSmart people.

  • Choice between UPK in-application help and standard EBS help

    Hi,
    We are on a EBS 11.5.10 project, implementing UPK.
    We got UPK in-application help working; changed custom.pll, set the profile option, everything fine.
    Now we would like the users to have the choice between UPK help (default) and standard EBS help.
    Therefore we opened the In-Application Support Player Configuration, and created a new Tab:
    Type: Oracle E-Business Suite help
    Tab Text: EBS help
    URL: ?
    Whatever we put in the URL, it won’t display the standard EBS context sensitive help. We can see the ‘EBS help’ tab when selecting ‘window help’ in the application but the page is blank or shows an error message.
    Do you have any tips on how to get this working?
    Thanks,
    Abe de Beer
    EBS Financials consultant
    Oracle Belgium

    Hi,
    I have the exact same requirtment, Could you please give the step what you have done so that it would be helpfull. Also after publishing the content on the i am not seeing the "Application Option" i am seeing the smart help. do we need to configure on "Application Option" or on smart help. Where ever is see the doc it says configure oracle_gateway.html but i dont see oracle/hemi folder at all. do know if there is a set up that has to be done to get this option (UPK 11.10.1)
    Thanks

  • Use of input  type="file"

    Hellow
    How can I use the HTML tag <input type="file" > in jsp/servlets ?
    how can I got the file and saving it?

    Take a look at this page: http://search.java.sun.com/search/java/?qt=jsp+upload&x=39&y=6 - it is a search page and you can use it to find whether or not anyone has asked the question you have before. Often you will find that the question you have asked has been asked before, sometimes as much as 29000 times. It is quicker than asking a question for the first time because you don't have to wait for replies. - they are already there. I also believe that if you don't know understand search engines you are unlikely to understand Java.
    To help with your search you may want to know that the "file" input type creates a Multipart request and that the term "com.oreilly.servlets" may well be relevant too.

Maybe you are looking for

  • Re: Can't print more than one page of a PDF

    I have Acrobat and Reader 9.3.3. With either program I can't print more than 1 page of any PDF despite changing settings. What will fix this problem? Thanks in advance for your help.

  • Controlling List Order

    If I have a list of objects referenced in my entity via a OneToMany relationship, is there anyway I can control that the items in that list be sorted? I know I can sort the list after the fact but is there a way for me to tell Toplink to add an order

  • Continue the package execution even if task fails

    I have a send mail task in my package which sends start and end mails of the package. If the SMPT server is down and not working entire process stops as send mail task fails. Is there a way that if the SMPT server is down and also if the send mail ta

  • Audioslave Interactive Booklet not working

    I purchased Audioslave's Revelations, which came with an "Interactive Booklet - Revelations" which doesn't seem to work. When I click on it, nothing happens (unlike the traditional PDF booklet opening). When I check the info it says it's a 12 second

  • Why is my Macbook Pro slow to sleep in Mountain Lion?

    When I choose sleep from the Apple menu it takes approx. 30 seconds before it decides to go to sleep. It gives me no notification that it is going to sleep until 30 seconds later when the screen goes black. Same thing if I close the lid, I can open i