Separation of Java and HTML in servlets

I'm starting on my first Java project. It will be a basic table maintenance app using Java Servlets. My question is, what would be a good way to keep my servlet code separated from the HTML code that will be used to generate the pages I'll display to the users. Should I have separate classes that produce each type of HTML? Just looking for a place to start. Thanks.

Yes it is good idea, essential even. There are three main ways to do this.
1) Use a third party template system like TEA, FreeMarker or WebMarco.
     http://freemarker.sourceforge.net/
http://opensource.go.com/Tea/index.html
http://www.webmacro.org/
2) Use the Model View Controller Pattern, the Servlet (the controller) processes the requests and dispatches it to a Jsp page (the view) containing beans that reference your data (the model). See this link ( http://java.sun.com/j2ee/blueprints/design_patterns/model_view_controller/index.html )
3) Produce your own Template system; with page loader/Parser, replacing the relevant 'custom tags' with the correct data.
My best solution depends on your circumstances,

Similar Messages

  • Java and HTML or PHP question

    I am not sure of my best course of action and would appreciate some input. My problem is this. I have written an application in java that communicates with a
    micro controller and passes information back and forth.I read info from sensors and relays and make changes to them. My current GUI is set up with tables to
    display this info. I am in the process of creating a graphics based interface to display the information in a web page but I am having trouble getting my
    java program to update the HTML page. I have considered using java to update a database with values and then reading the database with PHP and updating the
    HTML but I do not know how to get the java to run the PHP. I can use the java.awt.desktop API to display the html but I cant get it to display the .php files
    due to the server issues with PHP. I am not sure what I am looking for here. Javascript? AJAX? What I want is for the user to push a button that loads a
    web page and have java read that html file to determine which specific values to update, then update specific text boxes with those values from the
    micro controller. I already have the communication with my current java program. I know this is all a little confusing and convoluted and I apologize for
    that. I am just having a tough time formulating a plan of attack. Any ideas?
    Thanks in advance,
    Ray
    Any ideas are welcome and greatly appreciated.

    I am not sure of my best course of action and would appreciate some input. My problem is this. I have written an application in java that communicates with a microcontroller and passes information back and forth.I read info from sensors and relays and make changes to them. My current GUI is set up with tables to display this info. I am in the process of creating a graphics based interface to display the information in a web page but I am having trouble getting my java program to update the HTML page. I have considered using java to update a database with values and then reading the database with PHP and updating the HTML but I do not know how to get the java to run the PHP. I can use the java.awt.desktop API to display the html but I cant get it to display the .php files due to the server issues with PHP. I am not sure what I am looking for here. Javascript? AJAX? What I want is for the user to push a button that loads a webpage and have java read that html file to determine which specific values to update, then update specific text boxes with those values from the microcontroller. I already have the communication with my current java program. I know this is all a little confusing and convoluted and I apologize for that. I am just having a tough time formulating a plan of attack. Any ideas?
    Thanks in advance,
    Ray
    Any ideas are welcome and greatly appreciated.

  • Java and html again

    i need a java code that is able to take an html file and return all the sentences which contain a word like for example finishing with *omics and then it saves the sentenses in a database                                                                                                                                                                                                                                                                                                                                                                                       

    You can use a ParserCallback to get all the text in the Document.

  • Java and html

    Hi,
    Does anyone know how or where I can find information on how to create a html file with the use of Java.
    Thanks

    Hi,
    What I ment to say is: can I use
    createTempFile(prefix, suffix, File directory)
    to create a .html file. I suppose I can.
    Thanks for the reply

  • Can i add a servlet in oracle database for webservices without java and how?

    HI
    can i add a servlet in oracle database for webservices without java and how?
    Please help
    Thanks

    Dear Frank,
    I have done as follows
    created a form with a button, and in my button pressed event I wrote
    WEB.SHOW_DOCUMENT('javascript:openMyURL("http://192.168.1.34/HELP/ADMF0005.html");', '_Self');
    and in my formsweb.cfg I have the following
    HTMLbeforeForm=<script> function OpenMyURL(page){window.open(page,"myURL","width=700,width=400,top=0,left=0,toolbar=no,menubar=no"); } </script>
    When I click on the button it is coming with toolbar , etc as well as no page found is coming with the following in the address bar.
    javascript:openMyURL("http://192.168.1.34/HELP/ADMF0005.html");
    My html view source comes as below for the form
    <HEAD><TITLE>Oracle9iAS Forms Services</TITLE></HEAD>
    <BODY >
    <script> function OpenMyURL(page){window.open(page,"myURL","width=700,width=400,top=0,left=0,toolbar=no,menubar=no"); } </script>
    <!-- Forms applet definition (start) -->
    <OBJECT classid="clsid:CAFECAFE-0013-0001-0009-ABCDEFABCDEF"
    codebase="/forms90/jinitiator/jinit.exe#Version=1,3,1,9"
    WIDTH="1000"
    HEIGHT="660"
    HSPACE="0"
    VSPACE="0">
    <PARAM NAME="TYPE" VALUE="application/x-jinit-applet;version=1.3.1.9">
    <PARAM NAME="CODEBASE" VALUE="/forms90/java">
    <PARAM NAME="CODE" VALUE="oracle.forms.engine.Main" >
    I am using Forms [32 Bit] Version 9.0.2.7.0

  • How do I mix text and Html format in a java mail?

    How do I mix text and Html format in a java mail? some part I want to keep the text format, the other part I want to use Html functions(like fond, color, etc)

    You don't mix them. Pick one or the other.
    However if you want to have a text version and an HTML version, so that mail readers that don't handle HTML can see regular text instead, then you could produce a "multipart/alternative" message. There's an explanation of how to do that in this article:
    http://www-128.ibm.com/developerworks/java/library/x-xmlist2/

  • Pls Help--- URGENT... Combining XML file and HTML file Using java program.

    Hi, I need to implemnt this for my project....
    I need to combine XML and HTML file and generate a new HTML file
    Sample XML File:
    <user>
    <txtName>sun</txtName>
    <txtAge>21 </txtAge>
    </user>
    Sample HTML File:
    <body>
    Name: <input type="text" name="txtName" value=""
    Age : <input type="text" Age="txtAge" value=""
    </body>
    I need a java program to combine the above xml and html files and generate the output in HTML.
    Any kind of help is sincerely Appreciated.
    Thanks.

    toucansam wrote:
    So you want us to write it for you? It's pretty straight forward, first parse the xml file with the *[best java xml parser|http://www.google.com/search?&q=parsing+xml+in+java]* and then go through the nodes and construct the html with strings and concatination. Then write the file using *[the best java file writer|http://www.google.com/search?hl=en&q=writing+to+a+file+in+java]*.
    He would do better to use existing tools that make this easy [http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html|http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html]

  • Using java mail api without servlets, I ve sent an html mail.  In that Ive

    Using java mail api without servlets, I ve sent an html mail. In that Ive specified action to the servlet. On click, it shows url as file:///C:/Documents%20and%20Settings/sirivanig/Local%20Settings/Temporary%20Internet%20Files/Content.IE5/CNFHMDIT/updatemailerform%5B2%5D.htm instead of www.servername.com/....
    May I know the reason why it shows like this.
    Do I ve to send htmlmail through servlet so that it does show proper url?

    Possibly your mailer is restricting your access to URLs to prevent
    various scams. Without the details, it's hard to know what's going
    wrong.
    Have you tried with a different mailer?

  • Differences between Java Web Start and HTML-Applets???

    Hi,
    I'm trying to get information about the differences between JWS-Applets and 'normal' HTML-embedded Applets.
    Is it possible to develop both simultaneously in one project???
    Is there a Programming-documentation that describes the differences between JWS and HTML-Applets???
    Thanx!
    Rembrand

    Check out the link shown below:
    http://java.sun.com/products/javawebstart/1.2/docs/developersguide.html
    All you need really is to create a JNLP file to launch your applet/application.
    ;o)
    V.V.

  • Calling EJB with HTML via SERVLET

    Hi,
    I used a writen example that calls EJB from HTML via SERVLET. Example name is Bonus. The problem I have is that the HTML throw error while calling SERVLET. I dont figure out what seams to be a problem. Someone know?
    I wonder if the problem is in servlet? The EJB is fine!
    christian
    HTML CODE:(bonus.html)
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250"/>
    <TITLE>untitled1</TITLE>
    </HEAD>
    <BODY BGCOLOR = "WHITE">
    <BLOCKQUOTE>
    <H3>Bonus Calculation</H3>
    <FORM METHOD="GET" ACTION="BonusAlias">
    <P>Enter social security Number:<P>
    <INPUT TYPE="TEXT" NAME="SOCSEC"></INPUT>
    </P>
    Enter Multiplier:
    <P>
    <INPUT TYPE="TEXT" NAME="MULTIPLIER"></INPUT>
    </P>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    <INPUT TYPE="RESET">
    </FORM>
    </BLOCKQUOTE>
    </BODY>
    </HTML>
    SERVLET CODE:(BonusServlet.java)
    package mypackage5;
    import mypackage5.Calc;
    import mypackage5.CalcHome;
    import mypackage5.impl.CalcBean;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.beans.*;
    public class BonusServlet extends HttpServlet {
    CalcHome homecalc;
    public void init(ServletConfig config) throws ServletException{
    //Look up home interface
    try{
    //InitialContext ctx = new InitialContext();
    //Object objref = ctx.lookup("Calc");
    //homecalc = (CalcHome)PortableRemoteObject.narrow(objref, CalcHome.class);
    Context context = new InitialContext();
    CalcHome calcHome = (CalcHome)PortableRemoteObject.narrow(context.lookup("Calc"), CalcHome.class);
    Calc calc;
    catch (Exception NamingException) {
    NamingException.printStackTrace();
    public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    String socsec = null;
    int multiplier = 0;
    double calc = 0.0;
    PrintWriter out;
    response.setContentType("text/html");
    String title = "EJB Example";
    out = response.getWriter();
    out.println("<HTML><HEAD><TITLE>");
    out.println(title);
    out.println("</TITLE></HEAD><BODY>");
    try{
    Calc theCalculation;
    //Get Multiplier and Social Security Information
    String strMult = request.getParameter("MULTIPLIER");
    Integer integerMult = new Integer(strMult);
    multiplier = integerMult.intValue();
    socsec = request.getParameter("SOCSEC");
    //Calculate bonus
    double bonus = 100.00;
    theCalculation = homecalc.create();
    calc = theCalculation.calcBonus(multiplier, bonus);
    catch (Exception CreateException){
    CreateException.printStackTrace();
    //Display Data
    out.println("<H1>Bonus Calculation</H1>");
    out.println("<P>Soc Sec: " + socsec + "<P>");
    out.println("<P>Multiplier: " +
    multiplier + "<P>");
    out.println("<P>Bonus Amount: " + calc + "<P>");
    out.println("</BODY></HTML>");
    out.close();
    public void destroy() {
    System.out.println("Destroy");

    The error is that page cannot be found! When I run only the servlet it works, when I run the HTML page and enter the field throws eror that the page cannot be found!
    thanks
    Christian

  • Uploading a file using jsp and com.oreilly.servlet lib package

    Sorry to bother you but I need your help folks
    I am developing an application to pick up files from a database and sent to a specified location on a different system.
    I am presently trying to run this code,I have placed this lib package from oreilly which is supposed to encapsulate the usage of file uploads,which is a jar file called cos.jar into C:\Program Files\Java\jdk1.5.0_03\jre\lib\ext folder .I have a jsp page that calls the bean which does the upload and implement the classes in the oreilly package.I am using tomcat 5
    [b]the jsp page that acts as the user interface
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>Please Choose The File</title>
    </head>
    <body bgcolor="#ffffff">
    <table border="0"><tr>
    <form action="Upload.jsp" method="post"
    enctype="multipart/form-data">
    <td valign="top"><strong>Please choose your document:</strong><br></td>
    <td> <input type="file" name="file1">
    <br><br>
    </td></tr>
    <tr><td><input type="submit" value="Upload File"></td></tr>
    </form>
    </table>
    </body>
    </html>
    this is the jsp page that calls the bean
    <jsp:useBean id="uploader" class="com.UploadBean" />
    <jsp:setProperty name="uploader" property="dir" value="<%=application.getInitParameter(\"save-dir\")%>" />
    <jsp:setProperty name="uploader" property= "req" value="${pageContext.request}" />
    <html>
    <head><title>file uploads</title></head>
    <body>
    <h2>Here is information about the uploaded files</h2>
    <jsp:getProperty name="uploader" property="uploadedFiles" />
    </body>
    </html>
    [b]this is the bean class
    package com;
    import java.util.Enumeration;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.ServletRequest;
    import com.oreilly.servlet.MultipartRequest;
    import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;
    import javax.servlet.*;
    public class UploadBean {
    private String webTempPath;
    private HttpServletRequest req;
    private String dir;
    // private ServletRequest request;
    public UploadBean( ) {}
    public void setDir(String dirName) {
    if (dirName == null || dirName.equals(""))
    throw new IllegalArgumentException("invalid value passed to " + getClass( ).getName( )+".setDir");
    //webTempPath = dirName;
    dir = dirName;
    /* public String getDir()
    return webTempPath;
    public void setReq(ServletRequest request) {
    if (request != null && request instanceof HttpServletRequest)
    req = (HttpServletRequest) request;
    } else {
    throw new IllegalArgumentException("Invalid value passed to " + getClass( ).getName( )+".setReq");
    public String getUploadedFiles( ) throws java.io.IOException{
    //file limit size of 5 MB
    MultipartRequest mpr = new MultipartRequest(req,dir,5 * 1024 * 1024,new DefaultFileRenamePolicy( ));
    Enumeration enume = mpr.getFileNames( );
    StringBuffer buff = new StringBuffer("");
    for (int i = 1; enume.hasMoreElements( );i++){
    buff.append("The name of uploaded file ").append(i).append(" is: ").append(mpr.getFilesystemName((String)enume.nextElement( ))).append("<br><br>");
    }//for
    //return the String
    return buff.toString( );
    } // getUploadedFiles
    On running the code I find this error messages
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: javax/servlet/ServletRequest
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.jsp.Upload_jsp._jspService(org.apache.jsp.jsp.Upload_jsp:73)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NoClassDefFoundError: javax/servlet/ServletRequest
         com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:222)
         com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:151)
         com.UploadBean.getUploadedFiles(UploadBean.java:49)
         org.apache.jsp.jsp.Upload_jsp._jspService(org.apache.jsp.jsp.Upload_jsp:63)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    Apache Tomcat/5.5.9
    tanks

    Hi,
    Looks like you are missing a file from the classpath. Make sure servlet.jar is available in your classpath. Ordinarily files in <tomcat_home>/lib directory should be added automatically. You need to check why it hasn't been added in your case. A good place to start would be the bat files in the bin directory viz startup.bat, catalina.bat etc.
    cheers,
    vidyut

  • Java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicati

    Hi,
    I have an application which is executing properly in jboss 3.2.5 but as we are trying to upgrade the jboss version i am getting above mentioned error.
    The application is deployed in jboss as an ear file and the ear contains one jar file that has been removed from the ear and still i am getting this error.
    I am posting the full stack trace over here.
    ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
            at org.apache.jsp.Jsp.Common.logout_jsp._jspInit(logout_jsp.java:22)
            at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
            at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:158)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at clime.messadmin.filter.MessAdminFilter.doFilter(MessAdminFilter.java:104)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
            at java.lang.Thread.run(Thread.java:595)It is happening in logout.jsp, but all other main jsp's are working properly ( login.jsp etc ).
    I am posting the jsp code over here.
    <html>
    <head>
           <script language="JavaScript">
         function init()  {
           window.history.forward(1);
       </script>
      </head>
    <body  onLoad="init();" >
      <%@ page language="java" %>
      <%@ page isThreadSafe="true" %>
        <%
         session.invalidate();
         response.sendRedirect("../../logout.html");
    %>
    </body>
    </html>Please guide me to solve the issue.

    evnafets wrote:
    My guess would be that you have some of the servlet classes deployed with your application.
    Yes.
    Any jar files that contain the javax.servlet.* packages should NOT be part of a web application, but are intended to be on the server.
    First up all there is no such jar files.
    Common candidates:
    servlet.jar
    servlet-api.jar
    j2ee.jar
    All those jars are in lib directory of my app server. I have jsp-api and servlet-api.jar as i am using embedded tomcat 6 in jboss appsever.
    Check the WEB-INF/lib directory of your web application to see that there are none of those there.
    Nothing similar deployed in your ear file?I have extracted my application ear , jar and war then when i checked i found one jar file inside the war but in that no servlet*.jarr files. It is my application oriented files only. I have deleted this ar files and then i executedi am getting same error. Is there any way to find out the exact issue ????.
    Regards
    Rasa

  • Comparison - "JAVA" and "C"

    Hi,
    I just want to have a closer look at the comparison between the JAVA and the C Languages both in the System Side as well as in the Application Side. Please mail me a detailed view of my request. Expecting the earliest compose.
    Bye
    Chandra Kanth

    Well, a few things:
    The Java programming language is an object-oriented language and C is not. How important is that? Depends entirely on what you're doing.
    Java also has a HUGE class library at your disposal and C does not.
    For some types of applications it's easier to program in Java than in C. For others, C would work better.
    I think it's important to know what kind of programming you want to do. Java is great for GUIs, web server stuff like servlets that process forms, handle logins, etc, JavaServerPages, which handle HTML combined with scripplets or to call beans.
    I could be wrong, but I think there is more variety to what you can do with Java than with C. I hear, though, that C is better if you want to talk directly with hardware.
    Hope that helps some. Dana

  • Html inside  Servlet

    Im trying to create a HTML page that will be created and invoked from a servlet.
    In order to do so, I created the HTML page in Frontpage 2003 and then added it to the Servlet code using [out.println(" ............");] for each and every statement
    Now, I dont get the output as I would get when the page is directly executed.Remember I calling /creating the HTML page from a servlet.
    I have the replaced the " with \" so that wont be an issue here. Also the Java Servlet code compiles without any error.
    1. Now where I face a problem is when I add the Java Script codes they dont execute. For example I created a button using FrontPage and set the 3 modes for it ,
    - on mouse over
    -On mouse down
    - on mouse up.
    So they created 3 different functions and added their own code to the HTML page.I managed to add all of it to the servlet.
    But the picture just refuses to load!
    2. Also, when I use a plain Html code like,
    out.println(" <input src=getdetails.gif name= \"image\" type=\"image\" tabindex=\"8\">");
    the pic doesnt load. On looking at the properties of the picture I dont see the location of the picture instead I see http://localhost:8080/examples/servlet/TestServlet.
    So Can someone please help me embed the Java Script code inside my servlet code and also show me how to use the code in point 2.
    Thank you.

    Well actually the .HTML file having the javascript code works perfectly. This file was created using Frontpage 2003.
    But, when I copy-paste the same thing in my .JAVA and supply the absolute paths for the images, something misfires and I dont get the same result.
    If you would like to have a peek at it , this is the line as in the .HTML File
    <input img border="0" id="img1" src="button5.jpg" height="20" width="100" type ="image" alt="Button Text" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'button6.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'button5.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'buttonA.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'button6.jpg')" fp-style="fp-btn: Braided Column 3" fp-title="Button Text"></p>Now when I transfer it to the .JAVA file it becomes like this.
    pw.println("<input img border=\"0\" id=\"img1\" src=\"c:\\Images\\button5.jpg\" height=\"20\" type =\"image\" width=\"100\" alt=\"Book Flight\" onmouseover=\"FP_swapImg(1,0,/*id*/'img1',/*url*/\"C:\\Images\\button6.jpg\")\" onmouseout=\"FP_swapImg(0,0,/*id*/'img1',/*url*/\"C:\\Images\\button5.jpg\")\" onmousedown=\"FP_swapImg(1,0,/*id*/'img1',/*url*/\"C:\\Images\\buttonA.jpg\")\" onmouseup=\"FP_swapImg(0,0,/*id*/'img1',/*url*/\"C:\\Images\\button6.jpg\")\" fp-style=\"fp-btn: Braided Column 3; fp-font-size: 11; fp-font-color-hover: #FF0000; fp-font-color-press: #0000FF\" fp-title=\"Book Flight\"></p>");Can someone throw some light as to whats ,/*url*/ and do I still need to keep it in the code.
    Thank you.

  • HTML embedded servlet

    Hi,
    I am after some advice on Servlets. I have a web site running on Microsoft IIS 5.0. :( I need to write a HTML page that shows some static text (no problems here) and connects to an Oracle database that holds some images broken up into 2K chunks. To do this I was trying to write a servlet that was embedded in this HTML page.
    I have written the servlet and it connects to the database retrieves the image data and stores it in a ByteArrayOutputStream without a problem. I then convert this ByteArrayOutputStream to a byte array so I can write the image data to the screen using the response.getOutputStream().write(byte[]) method. The trouble is the response writer (I think that's what it's called) is already in use so when I call the getOutputStream method the servlet throws an exception.
    Can someone:
    1. Tell me if what I am trying to achieve is possible by calling a Servlet embedded in a HTML page. (I know it is possible when you are running a java web server and call the servlet from the url)
    eg.
    <body>
    <p>Output from servlet</p>
    <hr>
    <servlet
    codebase=""
    code="displayimage.DisplayImage.class"
    >
    </servlet>
    <hr>
    </body>
    2. If it is possible, how do I call the getOutputStream method without throwing an exception OR write the byte array to the client using the current writer that is in use (PrintWriter).
    I have tried numerous things such a setting the content type of the response to "image/jpeg" and converting the ByteArrayOutputStream to a string and writing this to the client with out success.
    Help would be greatly appreciated.
    Andrew

    Hi Andrew,
    1.
    I notice that you try to display an Image from the Oracle database and have some problem.
    There is another developer by the name Daizz that had the same problem. You may try contact to see how Daizz solve the issue.
    2. Please look the subject:
    problem about display jpg image in jsp daizz 3 Nov 12, 2001 11:39 PM
    You can send Daizz an email to see.
    --Paul

Maybe you are looking for

  • Lion Server for Home use reality check

    Hi All, as many others I had the best intentions buying Lion Server for my home network (5 Macs, 2 iPads, 2 iPhones) to manage everything. It was destined to be a central server for user management, configuration management, home directories, file se

  • Cannot open PS CC 2014

    I've just downloaded PS CC 2014. When I try to open it this error message comes up: Adobe Photoshop has stopped working.  A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is availabbl

  • Agent port passed by user  Is busy

    I'm helping with their OEM 12c evaluation and we cannot get past this issue :- Issue similar to below note: EM 12c: Agent Deployment Fails With Error: "Agent port passed by user is busy and cannot proceed with the configuration" (Doc ID 1473185.1), b

  • BP Consolidate

    Hi Experts, We are facing a problem in Incoming payment window at the time of the addition of the payment,System throw an exception: The Consolidate BP behind the one or more of the selected invoicesis different from the current consolidate BP. Pleas

  • Referencing cells in other tables

    I am trying to build an application that requires formulas that need to reference cells in another table. Is this possible. If not is there a way to have rows in a table hidden so that only the summary totals are showing. So far it appears neither ca