Browser detection code for JSP ?

Hi ,
          Im new to JSP (in case the question wasn't a give-away!!).
          I would like to know how to do a browser detect - becuase I have
          1 CSS for IE and another for Netscape.
          Is there some code snippet site that I can get it from, or can
          someone post it here please> >?
          Thanks heaps
          ROb
          

try:
          request.getHeader("User-Agent")
          If you want to see it, do something like:
          Browser: <%= request.getHeader("User-Agent") %>
          Hope that helps.
          Regards,
          Eric
          "rob" <[email protected]> wrote in message
          news:[email protected]..
          > Hi ,
          >
          > Im new to JSP (in case the question wasn't a give-away!!).
          >
          > I would like to know how to do a browser detect - becuase I have
          > 1 CSS for IE and another for Netscape.
          >
          > Is there some code snippet site that I can get it from, or can
          > someone post it here please> >?
          >
          > Thanks heaps
          >
          > ROb
          

Similar Messages

  • Weblogic 6.0 (SP2) generates incorrect java code for JSP with response.sendRedirect()

              Hi,
              Here are the steps to reproduce the problem with the examplesWebApp application
              bundled with wlserver6.0(sp2):
              Product: Weblogic server 6.0 (sp2)
              Browser: IE 5.0
              1. Add index.jsp as the welcome file in WEB-INF/web.xml
              2. Create index.jsp as below:
              <%
              response.sendRedirect("index.html");
              return;
              %>
              <html>
              <head>
              <title>Index JSP file</title>
              </head>
              <body>
              <font color="red">This is index.jsp file </font>
              </body>
              </html>
              3. Create index.html as below:
              <html>
              <head>
              <title>Index HTML file</title>
              </head>
              <body>
              <font color="red">This is index.html file </font>
              </body>
              </html>
              4. Run the examples server and make sure examplesWebApp is deployed on the examples
              server using the console
              5. Access the URL http://localhost:7001/examplesWebApp
              The page will display a compilation error as below:
              C:\bea\wlserver6.0\config\examples\applications\examplesWebApp\WEB-INF\_tmp_war_examplesServer_examplesServer_examplesWebApp\jsp_servlet\_index.java:89:
              unreachable statement
              out.print("\r\n<html>\r\n<head>\r\n<title>Simple html</title>\r\n</head>\r\n<body>\r\n<font
              color=\"red\">This is index.jsp page</font>\r\n</body>\r\n</html>\r\n");
              ^
              and a look at the generated java code for index.jsp (_index.java) will reveal
              the erroneous code snippet below in the jsp service method:
              try { // error page try block
              //[ /index.jsp; Line: 1]
              response.sendRedirect("index.html"); //[ /index.jsp; Line: 2]
              return; //[ /index.jsp; Line: 3]
              out.print("\r\n<html>\r\n<head>\r\n<title>Simple html</title>\r\n</head>\r\n<body>\r\n<font
              color=\"red\">This is index.jsp page</font>\r\n</body>\r\n</html>\r\n");
              } catch (Exception __ee) {
              while (out != null && out != _originalOut) out = pageContext.popBody();
              pageContext.handlePageException(__ee);
              The above web application works fine in Tomcat 3.2.X environment. The Weblogic
              server 6.0 servlet engine should not generate the "out.println()" corresponding
              to the html section of index.jsp. The moment it sees the "return", it should stop
              processing further.
              Can someone from Weblogic support team please verify this and let me know when
              this bug will be fixed?
              One interesting thing I noticed was when we last tried weblogic 6.0 at its beta
              stage, it worked fine after we put in a special patch jar file called "redirectfix.jar"
              we received from weblogic team but somehow it got re-introduced by the time it
              was released!!
              We are planning to migrate our product from tomcat 3.2.x to weblogic 6.0. Our
              product has a lot of pages with such conditional {response.sendRdirect("page.jsp");return;}
              blocks. We would really appreciate a faster response form weblogic team.
              Thanks in advance.
              sam...
              Sam Palanisamy
              Senior Software Engineer
              Manage.com
              2345 N. First Street First Floor
              San Jose CA 95131
              

    Why should it stop when it sees a return? Is that in the spec?
              Peace,
              Cameron Purdy
              Tangosol Inc.
              << Tangosol Server: How Weblogic applications are customized >>
              << Download now from http://www.tangosol.com/download.jsp >>
              "Sam Palanisamy" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              >
              > Here are the steps to reproduce the problem with the examplesWebApp
              application
              > bundled with wlserver6.0(sp2):
              >
              > Product: Weblogic server 6.0 (sp2)
              > Browser: IE 5.0
              >
              > 1. Add index.jsp as the welcome file in WEB-INF/web.xml
              >
              > 2. Create index.jsp as below:
              > <%
              > response.sendRedirect("index.html");
              > return;
              > %>
              > <html>
              > <head>
              > <title>Index JSP file</title>
              > </head>
              > <body>
              > <font color="red">This is index.jsp file </font>
              > </body>
              > </html>
              >
              > 3. Create index.html as below:
              > <html>
              > <head>
              > <title>Index HTML file</title>
              > </head>
              > <body>
              > <font color="red">This is index.html file </font>
              > </body>
              > </html>
              >
              > 4. Run the examples server and make sure examplesWebApp is deployed on the
              examples
              > server using the console
              >
              > 5. Access the URL http://localhost:7001/examplesWebApp
              >
              > The page will display a compilation error as below:
              >
              C:\bea\wlserver6.0\config\examples\applications\examplesWebApp\WEB-INF\_tmp_
              war_examplesServer_examplesServer_examplesWebApp\jsp_servlet\_index.java:89:
              > unreachable statement
              > out.print("\r\n<html>\r\n<head>\r\n<title>Simple
              html</title>\r\n</head>\r\n<body>\r\n<font
              > color=\"red\">This is index.jsp page</font>\r\n</body>\r\n</html>\r\n");
              > ^
              >
              > and a look at the generated java code for index.jsp (_index.java) will
              reveal
              > the erroneous code snippet below in the jsp service method:
              >
              > try { // error page try block
              >
              > //[ /index.jsp; Line: 1]
              > response.sendRedirect("index.html"); //[ /index.jsp; Line: 2]
              > return; //[ /index.jsp; Line: 3]
              > out.print("\r\n<html>\r\n<head>\r\n<title>Simple
              html</title>\r\n</head>\r\n<body>\r\n<font
              > color=\"red\">This is index.jsp page</font>\r\n</body>\r\n</html>\r\n");
              > } catch (Exception __ee) {
              > while (out != null && out != _originalOut) out =
              pageContext.popBody();
              > pageContext.handlePageException(__ee);
              > }
              >
              > The above web application works fine in Tomcat 3.2.X environment. The
              Weblogic
              > server 6.0 servlet engine should not generate the "out.println()"
              corresponding
              > to the html section of index.jsp. The moment it sees the "return", it
              should stop
              > processing further.
              >
              > Can someone from Weblogic support team please verify this and let me know
              when
              > this bug will be fixed?
              >
              > One interesting thing I noticed was when we last tried weblogic 6.0 at its
              beta
              > stage, it worked fine after we put in a special patch jar file called
              "redirectfix.jar"
              > we received from weblogic team but somehow it got re-introduced by the
              time it
              > was released!!
              >
              > We are planning to migrate our product from tomcat 3.2.x to weblogic 6.0.
              Our
              > product has a lot of pages with such conditional
              {response.sendRdirect("page.jsp");return;}
              > blocks. We would really appreciate a faster response form weblogic team.
              >
              > Thanks in advance.
              > sam...
              > Sam Palanisamy
              > Senior Software Engineer
              > Manage.com
              > 2345 N. First Street First Floor
              > San Jose CA 95131
              >
              >
              

  • This is my Jsp code for image upload in database:

    This is my Jsp code for image upload in database:
    -----------Upload.jsp----------------
    <html>
    <head>
    </head>
    <body bgproperties="fixed" bgcolor="#CCFFFF">
    <form method="POST" action="UploadPicture.jsp" enctype="multiform/form-data">
    <%! int update=0; %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.text.*" %>
    <%@ page import="java.sql.Date" %>
    <%@ page import="java.io.*"%>
    <%@ page language = "java" %>
    <%
    try
    String ct="3";
    String path;
    File image=new File(request.getParameter("upload"));
    path=request.getParameter("upload");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:itPlusElectronics","","");
    PreparedStatement pstmt=con.prepareStatement("insert into graphics values(?,?,?)");
    pstmt.setString(2,path);
    pstmt.setString(3,ct);
    InputStream is=new FileInputStream(path);
    pstmt.setBinaryStream(1, is, (int)(image.length()));
    int s=pstmt.executeUpdate();
    if(s>0)
    out.println("Uploaded");
    else
    %>
    unsucessfull
    <%}
    is.close();
    pstmt.close();
    catch(Exception e)
    }%>
    </p>
    <p><br>
    <img src="UploadedPicture.jsp">image</img>
    <p></p>
    </form>
    </body>
    </html>
    My database name is itPlusElectronics and the table name is "graphics".
    I have seen as a result of the above code that the image is stored in database as "Long binary data". and database table is look like as follows-------
    picture path id
    Long binary data D:\AMRIT\1-1-Picture.jpg 3
    To retrive and display i use this JSP code as--
    ------------------------UploadedPicture.jsp------------------------------
    <html>
    <head>
    </head>
    <body bgproperties="fixed" bgcolor="#CCFFFF">
    <%! int update=0; %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.text.*" %>
    <%@ page import="java.io.*"%>
    <%@ page language = "java" %>
    <%@page import="javax.servlet.ServletOutputStream"%>
    <%
    try
    String path;
    path=request.getParameter("upload1");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:itPlusElectronics","","");
    PreparedStatement pst = con.prepareStatement("SELECT * FROM graphics WHERE id ='3'");
    // pst.setString(3, id);
    ResultSet rs = pst.executeQuery();
    path=rs.getString("path");
    if(rs.next()) {
    byte[] bytearray = new byte[4096];
    int size=0;
    InputStream sImage;
    sImage = rs.getBinaryStream(1);
    response.reset();
    response.setContentType("image/jpeg");
    response.addHeader("Content-Disposition","filename=path");
    while((size=sImage.read(bytearray))!= -1 )
    response.getOutputStream().write(bytearray,0,size) ;
    response.flushBuffer();
    sImage.close();
    rs.close();
    catch(Exception e)
    %>
    </body>
    </html>
    Now after browsing a jpg image file from client side and pressing submit button ;
    I am unable display the image in the Upload.jsp file.Though I use
    <img src="UploadedPicture.jsp">image</img> HTML code in Upload.jsp
    file .
    Now I am unable to find out the mistakes which is needed for displaying the picture in the Upload.jsp page..
    If any one can help with the proper jsp code to retrive and display the image ,please please help me !!!!!!!!!!!!!!!!!!!!!!!!!!

    dketcham wrote:
    cotton.m wrote:
    >
    2) I'm looking at how you called stuff, and you're trying to call the jsp file as an image? That jsp isn't the source of the image, just a page linking to an image. I think if you really want to do things that way you're going to need to just include that jsp within the jsp you're calling it from (or you can do it the easy way, and if you have the information to get the path of the image you want, you could simply call the image from the first jsp you posted)This is incorrect.
    There are two JSPs. The second when called will (if it worked) return the source of an image as stored in the database.even when called with <img src=xx.jsp>??
    Yes.
    If any of what I say next seems obvious or otherwise negative I apologize, just trying to explain and I don't know what you know vs what you don't.
    The link in the src is just a URL not a filetype. So just because it ends with JSP does not mean it has to return HTML. The content type is determined by the browser using the Content-Type header returned by the server in the HTTP response. In this case the header is set to be a jpeg so that's what the browser will attempt to interpret the content part of the response as.
    So in fact one is not limited to just HTML or images but whatever content type you would like to return (that the browser can understand anyway). This could be HTML or it could be an image of some type or it could be a PDF or it could be an Excel spreadsheet. All you have to do in the JSP is set the header appropriately and then send content that is actually in that format.
    This does not just apply to JSP by the way but all other web programming languages. You can do similar things to produce the same results in PHP, Perl, ASP etc.
    The only JSP/Servlet complication is whether or not doing this in a JSP is a "good" idea but I am not an expert enough at that to make a definitive statement. Mostly though JDBC in a JSP is a no-no.

  • Does Weblogic Provides any in built utility for server side browser detection

              Hi
              Does Weblogic Provides any in built utility or package for server side browser
              detection i.e. to know the browser details
              of the client with the first request.
              One such available product is BrowserHawk(http://www.cyscape.com).
              any thing similar to this available?
              Thanks in advance
              Mrutyunjay
              

    Hey Mohammed,
              yes, you could use just wl server to do file uploading. in your html client
              code, you need to specify the type of the data that you are sending as
              follows:
              <form action="UploadTestServlet" enctype="multipart/form-data" method=POST>
              File: <input type=file name=file><br>
              <input type=submit>
              </form>
              This will send your file to be processed by the UploadTestServlet. You need to
              code UploadTestServlet yourself to parse and extract useful data. check out
              www.servlets.com for a utility class that does just that
              Winston
              Mohammed Ali Usmani wrote:
              > Hi to All;
              >
              > I want to know if I can use weblogic (webserver) for file uploading from
              > client browser without using any ftp server.
              > Do I have to use some special code (may be in my servlet/html page) for
              > handling this. I mean that do I have to provide the implementation of RFC
              > 1867 by myself at server side?
              >
              > Or it is just merly a browser support? It doesn't effect the webserver at
              > all?
              >
              > Thanks
              

  • JSP codes for running a JAVA program

    hello...
    does anyone know the JSP codes for running a Java program from my web page?? i mean i already have my java program compiled... and i just want this java program to run in the background when I click on a button or a link...
    Any idea about this?
    plz advice..
    avi

    yes... u r somewhat right... but this runs on Jakarta Tomcat...
    i'm using the Apache Http Server together with the ServletExec AS which enable the Apache server to run JSP..
    I've created a package where i've put my classes...
    WEB-INF/classes/tbd(package name)/my classes
    and i've added.. package name.. in my java program..
    and then in jsp... i've written..
    <%@ page import="tdb.*"%>
    <jsp:useBean id="exec" class="tdb.textdb" />
    <%exec.convert_data();%>
    but when i run the page it says the package does not exist...
    can anyone tell where to place the folder WEB-INF so that it can run fine?
    thx
    avi

  • I need php code for copy paste our all histroy of browser in a text page.

    I need php code for copy paste our all histroy of browser in a text page can any one send me the code please.

    You can use an application like GarageSale for doing this....
    http://www.macupdate.com/info.php/id/16035/garagesale

  • Jsp code for image compression

    Hai,sir this is surendra i am doing a project using jsp and mysql.
    In that each user can put his image and i am storing that image in mysql blob but that results to that database size.
    So i need jsp code for image compression or another way for storing images.

    There's no need to store images in db. You may store them in a dedicated folder.

  • Urgently Need Code for Copy & Paste from Html Table in JSP to Excel file

    I am creating a html table in JSP file .
    I need code for 'Cut,Copy,Paste' functions ie. if someone wants to copy data from my table to excel file or from excel file to html table he shud be able to do that.
    Can someone give me code for 'Cut,Copy and Paste' i.e. some javascript functions which can do cut, copy and paste which i can put in my jsp file
    Thanks
    Message was edited by:
    javatechguru2007

    package com.chinmayananda
    public class Tetris{
    // complete here
    code]
    public abstract class AbstractTetris {
       public abstract void start();
       public abstract void stop();
    }nearly done

  • Html code for closing the browser window on logoff.

    Hello,
    I am using the logoff redirecrt url feauture to divert the logoff page to a custom made html page. I want this page should be closed automatically after being called i.e. when I click the logoff button it should divert to this custom html page and than close the browser automatically.
    Can you please help me with the code for this custom html page so that it closes the whole browser automatically when it get called.
    Regards
    Deb

    Don't know about the coding. May be we can do it by setting the property
    Initial State - Open or Closed or may be make that window Invisible.
    Others will advice you soon related to this.
    Regards
    Puneet

  • java code for intrusion detection system

    hi
    how can i write a java code for intrusion detection system wireless network (steps)
    help please whith any documentation , exemples , name of packages thank you

    hi
    anyone have code source java projet of an IDS intrusion detection system for VANET and thank you

  • JSP code for Alarm

    Hi i need to create an Alarm UI in JSP page. Like what Time CPU,Memory ,concurrent value goes above the marked value(90% usage) should be highlight in different colour like Red. All this data are stored on Oracle database. need to show in an JSP Can some one provide code similar to that thanks

    Saish wrote:
    http://www.google.com/search?q=java+socket+tutorial
    The very first result that came up was Sun's tutorial on sockets: http://java.sun.com/docs/books/tutorial/networking/sockets/
    Writing these in a JSP is generally no different than doing so in Java source file, except you will need to surround the Java code with JSP scriptlet tokens: http://www.jsptut.com/Scriptlets.jsp
    However, I would advise instead writing the socket code in a regular Java object and then invoking that from your JSP. You really don't want to have code in the JSP if you can help it.
    - SaishYou advise to use scriptlets. You know you will have to spend a year or two in purgatory for that!
    Be cool, use a servlet for this.

  • Code for browsing a file in idoc

    i have used the same code for browsing a file in idoc as we use in hcsf, but when that hcsf is converted in hcsp,then that field is still editable even after i wrote
    <$if isHcsp$><$isInfoOnly=1$><$endif$>
    its urgent ..

    HCSF/HCSP code should have the < ! - - syntax, not the < $ syntax... if that your problem?

  • Need Sample source code for Forum in jsp

    Hi..
    Please tell me the website which is having the sample source code for simple forum... I have to implement it into my project... kindly help me out...
    thanx in advance
    kumar

    Hi..
    Please tell me the website which is having the sample source code for simple forum... I have to implement it into my project... kindly help me out...
    thanx in advance
    kumar

  • Generated servlet error - unable to compile class for JSP - using NB5.5/SS9

    I am using NB5.5 beta2 and Sun server 9.0 with JSF 1.1 - all is OK when I am creating firts JSF application - welcomeJSF.jsp page is rendered normally - but when I am adding one more jsp with JSP view and so on - then - I am getting errors in both JSF pages - both - in original welcomeJSF and the new invoice.jsp page
    here is code for typical error
    org.apache.jasper.JasperException: Unable to compile class for JSP
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    [javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:99: cannot find symbol
    [javac] symbol : method setJspId(java.lang.String)
    [javac] location: class com.sun.faces.taglib.jsf_core.ViewTag
    [javac] jspxth_f_view_0.setJspId("id7");
    [javac] ^
    Generated servlet error:
    [javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:144: cannot find symbol
    [javac] symbol : method setJspId(java.lang.String)
    [javac] location: class com.sun.faces.taglib.html_basic.OutputTextTag
    [javac] jspxth_h_outputText_0.setJspId("id17");
    [javac] ^
    Generated servlet error:
    [javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:145: setValue(java.lang.String) in com.sun.faces.taglib.html_basic.OutputTextTag cannot be applied to (javax.el.ValueExpression)
    [javac] jspxth_h_outputText_0.setValue(org.apache.jasper.runtime.PageContextImpl.getValueExpression("Java Server Faces", (PageContext)_jspx_page_context, java.lang.Object.class, null));
    [javac] ^
    [javac] 3 errors
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:94)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:384)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:461)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:528)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:507)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:530)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:409)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:317)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:414)
         com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:455)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:139)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
         com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
         com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
         com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
         com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
         com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    note The full stack trace of the root cause is available in the Sun Java System Application Server Platform Edition 9.0 logs.
    and there is output for another error:
    Generated servlet error:
    [javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:144: cannot find symbol
    [javac] symbol : method setJspId(java.lang.String)
    [javac] location: class com.sun.faces.taglib.html_basic.OutputTextTag
    [javac] jspxth_h_outputText_0.setJspId("id17");
    [javac] ^
    Generated servlet error:
    [javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:145: setValue(java.lang.String) in com.sun.faces.taglib.html_basic.OutputTextTag cannot be applied to (javax.el.ValueExpression)
    [javac] jspxth_h_outputText_0.setValue(org.apache.jasper.runtime.PageContextImpl.getValueExpression("Java Server Faces", (PageContext)_jspx_page_context, java.lang.Object.class, null));
    [javac] ^
    [javac] 3 errors
    and here is code of my new invoice.jsp page:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <%--
    The taglib directive below imports the JSTL library. If you uncomment it,
    you must also add the JSTL library to the project. The Add Library... action
    on Libraries node in Projects view can be used to add the JSTL 1.1 library.
    --%>
    <%--
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <f:view>
       <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
          <h1><h:outputText value="Java Server Faces" /></h1>
        <h:inputText value="#{managerBean.currentInvoice.id}"/>
        <h:inputText value="#{managerBean.currentInvoice.description}"/>
        <h:inputText value="#{managerBean.currentInvoice.total}"/>
        <h:commandButton value="new_invoice"
                         type="submit"
                         actionListener="#{managerBean.createNewInvoice}"/> 
        </body>
    </f:view>and faces-config.xml file:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <!-- =========== FULL CONFIGURATION FILE ================================== -->
    <faces-config>
        <managed-bean>
            <managed-bean-name>managerBean</managed-bean-name>
            <managed-bean-class>com.brl.ERPSolution.ui.ManagerBean</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
    </faces-config>managerBean was intended to be backing beans which will call the facaed beans of EJB 3.0 entity beans - but at presnet - almost empty methods are declared there:
    package com.brl.ERPSolution.ui;
    import javax.faces.event.ActionEvent;
    import com.brl.solutions.EJB3.*;
    * @author Administrator
    public class ManagerBean {
        protected int currentInvoiceId;
        protected Invoices currentInvoice;
        protected InvoicesFacade invoicesFacade;
        /** Creates a new instance of ManagerBean */
        public ManagerBean() {
        /* business methods */
        public void createNewInvoice(ActionEvent actionEvent)
            invoicesFacade.create(this.currentInvoice);
        public Invoices getCurrentInvoice()
            return this.currentInvoice;
        public void setCurrentInvoice(Invoices currentInvoice)
            this.currentInvoice=currentInvoice;
    }I read in one blog (actually - the only page which was returned by yahoo - so - this should be very rare error!!!) to try to use Sun server's verifier.bat - and - it reported 0 errors and 0 warning. Build was succesfull as well and also - deployment was without errors - but - above mentioned error appeared during the automatic compilation of jsp pages/servlet when newly deployed jsps are first accessed from remote browser.
    So - is it possible, please, to receive some advice - what to do further? I feel that my invoice.jsp page can be with errors, - however - the original welcomeJSF.jsp should be working without errors even the erronwous JFS jsp page is added to web application.
    Thans for any adice or hint in advance!!!

    OK - I have made 'clean and build main project' from NB menu and the deployed the resulting *.war and the error messages have disappeared... So - it seems to be bug...

  • Opening a new Broswer Window using Java code inside JSP

    Dear Fellow Java Developers:
    I have written a JSP that presents information about a particular item. I want to give an option to the customer to click on the picture of the item to get a larger view. However, I don't want the browser window that opens to have the usual buttons and menubar at the top like a typical browser window, I just want it to be a window with a large image of the item. A good example of this is on the following website:
    http://www.eddiebauer.com/eb/product.asp?product_id=24701&nv=2|21472|9|32&lview=&cm_cg=&tid=&c=&sc=&lp=w1i005
    Click on the picture of the shirt on this page and you'll see what I am talking about. How is this accomplished using a Java scriplet? I have checked the source code for the above site, as well as others, and they all achieve this using JavaScript. Is there a way of accomplishing this using pure Java and/or HTML?
    Just wondering.
    Thanks in advance to everyone that replies.
    Sincerely;
    Fayyaz

    you seem to miss the client/server side setup. Your java is executing on the SERVER and it processes a request which in turn sends pure HTML and javascript to the client. What you want to do has to be done on the CLIENT, so JavaScript is the only option.

Maybe you are looking for

  • Java Bean does not display in Forms 9i

    Hi, I created a Java bean taht would not display in a Forms 9i application. I do not get any error messages, just nothing seem to happen. I did the following: 1. Created a Java Bean with az Init() public function, packed it into a jar file and put it

  • Two problems with iTunes (permissions issue?)

    Hello, I have two problems with iTunes. I am not sure if they are related that's why I post them both. 1) iTunes doesn't delete apps after updating them anymore. This is happening since the (two?) last versions of iTunes and is the same with 10.5. Th

  • Confused with Calendars and TimeZones

    Hi, I'll explain what I want to do. I have a table with several of what I call a "Time Ranges". Each Time Range has a day (day of week), beginTime and endTime. I also have different clients, each from a different country. Each client has a timezone a

  • Peoplesoft or SAP -HR ?

    Which has more demand in the current job market ? -  Peoplesoft or SAP - HR ? I am planning to take up one of these two and do a complete course/certification on it . Pls advice

  • How do I down load you tube vid?

    I'm a new and proud owner of the new I pad ,but I can't seem to find any apps for the my ipas too down load YouTube vids?