JSP 1.2 and jsp:setProperty

Has anyone got an idea why they decided to change the way the tag jsp:setProperty is handled?
In the JSP 1.1 specification, the condition to be checked before calling a single property set method was that the request contained the corresponding parameter, no matter what its value was, and the generated code would look something like this
String s1 = request.getParameter("example");
if (s1 != null) setExample(s1);
In the JSP 1.2 specification, it says the property is set only if the corresponding parameter' s value is not an empty string, as in
String s1 = request.getParameter("example");
if (s1 != null && s1.length() > 0) setExample(s1);
Which is what it would do with the setProperty with property="*", according to the JSP 1.1 specification.
This will cause me some trouble, because I will have to change my JSPs code in order to have bean variables set to empty string when the user doesn't input any value in the form (with beans having scope "session", of course).

I have not found any reasonable explaination for this.
The easiest fix that I could think of was on my JSP
pages before I submit I check to see if the value of
the field is "", if it is I set the value to
"emptyString". On the bean side I check the value of
the field property passed to see if it is
"emptyString" if it is I set it to "".
But this all seems an annoying nuisance when an empty
string is a perfectly valid value.I think I will fix it by having a reset method called in every JSP containing a form after the form itself has been "written" on the output stream with its fields' values. The thing is that I can't really find a good reason for this change they made: I can't believe there's a developer out there who would find this an improvement. The only thing I can think of is that they wanted to make the setProperty for a single property and the setProperty with property="*" have the same behaviour (the one I don't like).

Similar Messages

  • Difference between jsp:forward sendRedirect and jsp include directive

    Am very much confused, please explain me the difference between
    jsp:forward sendRedirect and jsp include directive with a suitable example.
    I'll be very gratefull. Its very urgent.

    One basic difference. The include executes in the .jsp servelet created. The redirect transfers "control" by redirecting the client request to another destination. In other words, the current .jsp is no longer in charge or in the calling chain in any way.

  • Difference between the implementaion of JSP in JBoss and JSP in weblogic

    The JSP file that deploys in JBoss, does not deploy in weblogic 6.1. I do not know
    the reason. Please do let me know.
    1) I am using JBoss 3.0 and tomcat 4.0.3. Also, I am using weblogic 6.1.
    2) A description of the JSP and its dependencies
    This part of the java code in JSP is used for right-click:
    function clickMenu()
         contextMenu.releaseCapture();
         contextMenu.style.display="none";
         el=event.srcElement;
         if (el.id=="AddMenuItem")
              if (referencing)
                   createAndAddNewRow();
              else
                   createNewRow();
         else if (el.id=="DeleteMenuItem")
              if (referencing)
                   dropRow();
              else
                   deleteRow();
         return;
    This part of the code enables right-clicking in the body of the JSP.
    <body leftmargin="3" topmargin="3" link="#000000" vlink="#000000" alink="#000000"
    background="images/frame_bg.jpg" </jsp:text><jsp:expression>toggle?"oncontextmenu=\"displayMenu();
    return false\" class=\"clickableSpan\"":""</jsp:expression><jsp:text>></jsp:text>
    3) With the same code above, there is no right-clicking enabled in case of weblogic
    6.1.
    4) There are no error or log messages in weblogic.
    5) The error I get in the jsp file is only specific to netscape. There are no
    errors in case of ie. In netsacpe, I get the error "document.all has no properties"
    The lines below are all the lines which are part of the jsp file containing document.all
    <td background="images/activ_center.jpg" align="left"><input type="image" border="0"
    src="images/left_arrow.gif" name="scrollUpBtn" onMouseOut="document.all.scrollUpBtn.src='images/left_arrow.gif'"
    onMouseOver="document.all.scrollUpBtn.src='images/left_arrow_over.gif'" onClick="scrollUp()"/></td>
    <td background="images/activ_center.jpg" align="left"><input type="image" border="0"
    src="images/right_arrow.gif" name="scrollDownBtn" onMouseOut="document.all.scrollDownBtn.src='images/right_arrow.gif'"
    onMouseOver="document.all.scrollDownBtn.src='images/right_arrow_over.gif'" onClick="scrollDown()"/></td>
    <jsp:text><td background="images/activ_center.jpg" align="left"><input type="image"
    border="0" src="images/toggle.gif" name="toggleBtn" onMouseOut="document.all.toggleBtn.src='images/toggle.gif'"
    onMouseOver="document.all.toggleBtn.src='images/toggle_over.gif'" onClick="toggle()"/></td><td
    background="images/activ_center.jpg" align="left">      </td></jsp:text>
    <jsp:text><td background="images/activ_center.jpg" align="left"><input type="image"
    border="0" src="images/report.gif" name="reportBtn" onMouseOut="document.all.reportBtn.src='images/report.gif'"
    onMouseOver="document.all.reportBtn.src='images/report_over.gif'" onClick="report()"/></td><td
    background="images/activ_center.jpg" align="left">      </td></jsp:text>
    Please do let me know if you think of the error now.
    Thank you
    Ronak Parekh

              Are you using one of the extensions that are available on the Web? If so is the
              software installed correctly?
              

  • WL vs. WL-express and JSP vs. javascript/SQL

    folks-
    i am trying to convince a certain party to
    disband a web-based job tracking system being
    written in ASP, javascript, html, css and SQL.
    it will be hosted on MS webserver running NT.
    i am trying to convince them to use JSP and
    WL express. i have done two years of EJB
    component work on weblogic, however, i have not
    done work with JSP or thin-clients. i was mostly
    business-logic.
    anyway i have some questions and need some
    direction. i already know JSP is better than
    ASP/javascript etc. because:
    * ASP is proprietary. ditto for VBscript
    * with an IDE creating JSP is easy and JSP
    automatically creates servlets which is way
    faster than by hand
    * JSP is JAVA based and hence benefits from
    all the portability pluses of JAVA
    but here are the more difficult questions:
    * why is WL express better than an MS
    web server? (not including WL market share
    and size. after all MS can claim that)
    * since WL express does not have an EJB
    container, how do you access the database?
    via JDBC? does one just have JDBC code
    floating around?
    * since there is no EJB container how does
    one separate presentation from logic from
    data access? this is a major downside of
    javascript, html, css and SQL etc.
    * if a web app grows beyond JSP with WL express
    into the need for an EJB container, i would
    think that most of the app needs to re-written
    as business-logic must be refactored into EJBs
    and all JDBC code will be replaced by container
    managed beans. this sounds a like a lot of
    rework.
    * isn't JSP slower than javascript as the
    servlet and hmtl code is bounced back and
    force across the network?
    with respect to architecture, scalability,
    and robustness what are the downsides to an
    MS webserver and non-JSP coding?

    * since WL express does not have an EJB
    container, how do you access the database?
    via JDBC? does one just have JDBC code
    floating around?
    Use JDO or an OR-mapper or embed JDBC into your own data access classes.
    * since there is no EJB container how does
    one separate presentation from logic from
    data access? this is a major downside of
    javascript, html, css and SQL etc.
    Presentation=JSP
    Logic=Servlet
    Data access=JDO or similar
    * if a web app grows beyond JSP with WL express
    into the need for an EJB container, i would
    think that most of the app needs to re-written
    as business-logic must be refactored into EJBs
    and all JDBC code will be replaced by container
    managed beans. this sounds a like a lot of
    rework.
    You should be able to tell up front if it a tx-intensive app that requires
    WLS.
    * isn't JSP slower than javascript as the
    servlet and hmtl code is bounced back and
    force across the network?
    They aren't exclusive. For dynamic pages, use Javascript on the front end,
    JSP on the back.
    * with respect to architecture, scalability,
    and robustness what are the downsides to an
    MS webserver and non-JSP coding?
    In the real world, and for most apps, while Java has the architectural edge,
    they both have similar scalability and similar robustness. MS gives you no
    choice though, and you rewrite every time they see a new buzzword. You can't
    leave MS-land without abandoning almost everything. You can leave WLS in a
    week if you have to.
    It's an investment. Invest wisely.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "shane miller" <[email protected]> wrote in message
    news:[email protected]...
    folks-
    i am trying to convince a certain party to
    disband a web-based job tracking system being
    written in ASP, javascript, html, css and SQL.
    it will be hosted on MS webserver running NT.
    i am trying to convince them to use JSP and
    WL express. i have done two years of EJB
    component work on weblogic, however, i have not
    done work with JSP or thin-clients. i was mostly
    business-logic.
    anyway i have some questions and need some
    direction. i already know JSP is better than
    ASP/javascript etc. because:
    * ASP is proprietary. ditto for VBscript
    * with an IDE creating JSP is easy and JSP
    automatically creates servlets which is way
    faster than by hand
    * JSP is JAVA based and hence benefits from
    all the portability pluses of JAVA
    but here are the more difficult questions:
    * why is WL express better than an MS
    web server? (not including WL market share
    and size. after all MS can claim that)
    * since WL express does not have an EJB
    container, how do you access the database?
    via JDBC? does one just have JDBC code
    floating around?
    * since there is no EJB container how does
    one separate presentation from logic from
    data access? this is a major downside of
    javascript, html, css and SQL etc.
    * if a web app grows beyond JSP with WL express
    into the need for an EJB container, i would
    think that most of the app needs to re-written
    as business-logic must be refactored into EJBs
    and all JDBC code will be replaced by container
    managed beans. this sounds a like a lot of
    rework.
    * isn't JSP slower than javascript as the
    servlet and hmtl code is bounced back and
    force across the network?
    with respect to architecture, scalability,
    and robustness what are the downsides to an
    MS webserver and non-JSP coding?

  • Difference Between Jsp1.2 and Jsp 2

    Hello All
    Can anyone tell me the difference between Jsp 1.2 and Jsp 2.
    What are disadvantages of earlier version and how they are rectified in this latest version.
    Thank U

    The site below describes the differences and dis/advantages:
    http://developer.java.sun.com/developer/technicalArticles/javaserverpages/JSP20/

  • Weblogic 9 and JSP compiler errors

    Hello everyone,
              I am having problems with my Jsps in my EAR file deployed on WL 9.0.
              I have a Jsp called upms.jsp that contains the following code snippets:
              After my import statements, I have some code that creates a resource bundle that accesses a properties file:
               <%!
                   ResourceBundle bundle = null;
                   public void jspInit() {
                   bundle = ResourceBundle.getBundle("conf.properties");
              %>
              I get an error from the above code:
              upms.jsp:3:11: 'try' statement has neither 'catch' nor 'finally' clause
                        import="java.util.ResourceBundle"
              ^----------------------^
              I am totally clueless as to what that error means.
              Next I declare a bean I use in the jsp:          
                   <jsp:useBean
                        id="userPrefsManagerBean"
              class="controllers.beans.UserPreferencesManagerBean"
                   scope="session">
                   </jsp:useBean>
                   <jsp:setProperty name="userPrefsManagerBean" property="*" />
              I get these errors from the above portion:
              upms.jsp:27:3: The qualifier of this name is a package, which cannot contain fields.
                   <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: The qualifier of this name is a package, which cannot contain fields.
                   <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Expression expected (found '.' instead)
                   <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Syntax error: expected ) (found 'class' instead)
                   <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Syntax error: expected <identifier> (found ')' instead)
                   <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              Has anyone encountered these before?
              This jsp worked perfectly well when I deployed my EAR file on JBoss...no such luck using Weblogic.
              Is there something I am missing here? I appreciate any help.
              Cheers, :-)
              M.

    Mildred,
              Two suggestions:
              1) use option weblogic.jspc's "-keepgenerated", you can keep the generated
              servlet's source code.
              Please paste it here.
              2) Can you create a simple reproducer(e.g. a war), and put it here, so that
              we can debug it and give more clues.
              To reproduce your issue, I write a simple a simple
              UserPreferencesManagerBean classs below :
              package controllers.beans;
              public class UserPreferencesManagerBean {
              private int p1;
              public void setP1(int p)
              p1 = p;
              public int getP1()
              return p1;
              But it works(oh, I run it under 910MP1).
              We cannot tell too much without your further information
              Thanks
              Leon
              <Mildred A> wrote in message news:[email protected]...
              I am still fighting with this issue.. Dang!
              I don't know what to change in my JSP because the WL JSP compiler errors are
              so out there..
              Here is the first portion of the JSP file:
              <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
              session="true"
              pageEncoding="ISO-8859-1"
              import="java.util.ArrayList"
              import="java.util.HashSet"
              import="java.util.Date"
              import="java.util.Collections"
              import="java.util.ResourceBundle"
              %>
              <%!
              ResourceBundle bundle = null;
              public void jspInit() {
              bundle = ResourceBundle.getBundle("conf.properties");
              %>
              <jsp:useBean
              id="userPrefsManagerBean"
              class="controllers.beans.UserPreferencesManagerBean"
              scope="session">
              </jsp:useBean>
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              Below is the error I get from this section alone (after precompiling):
              upms.jsp:3:11: 'try' statement has neither 'catch' nor 'finally' clause
              import="java.util.ArrayList"
              ^-----------------^
              upms.jsp:27:3: The qualifier of this name is a package, which cannot contain
              fields.
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: The qualifier of this name is a package, which cannot contain
              fields.
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Expression expected (found '.' instead)
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Syntax error: expected ) (found 'class' instead)
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Syntax error: expected <identifier> (found ')' instead)
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Expression expected (found 'catch' instead)
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Illegal use of an expression as a statement.
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: No variable or field with this name could be found at this
              location.
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: No variable or field with this name could be found at this
              location.
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Syntax error: expected ) (found '__ee' instead)
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Illegal use of an expression as a statement.
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Syntax error: expected ; (found ')' instead)
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: No variable or field with this name could be found at this
              location.
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: No variable or field with this name could be found at this
              location.
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              upms.jsp:27:3: Syntax error: expected } (found 'EOF' instead)
              <jsp:setProperty name="userPrefsManagerBean" property="*" />
              ^-------------^
              Can anyone see what I am doing wrong here? ?:| ?:|
              Cheers,
              M

  • Change header and footer in one jsp impact on all jsps

    If i change header and footer in one jsp page it show reflect the changes in all jsps can any one help me .

    Manually i shd not change in all jsp pages.Once if
    i change in particular page then all pages shd be
    e reflected with the changesyes, my previous reply does the same way you want.
    You have to include (use include directive) your header & footer jsp file in other jsp pages where you wanted them. And once you do any change in header & footer jsp it will automatically effect other jsp.
    Follow the link if you dont know how to use include directive
    http://javaalmanac.com/egs/javax.servlet.jsp/include.jsp.html?l=new

  • Connection Pooling and JSP Custom Tag Library - is code (inside) the best way/correc?

    Hi, can anyone advise as to whether my tag library code (based
    on Apache Jakarta Project) will actually achieve connection
    pooling functionality across my entire JSP based application? I
    am slightly concerned that my OracleConnectionCacheImpl object
    may exist multiple times, hence rendering my conection pooling
    attempt useless.
    package com.solved.tag.dbtags.connection;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    import javax.servlet.jsp.JspTagException;
    import javax.sql.DataSource;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import oracle.jdbc.pool.OracleConnectionCacheImpl;
    * <p>JSP tag connection, used to get a
    * java.sql.Connection object.</p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>connection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.ConnectionTag&lt;/t
    agclass>
    * &lt;bodycontent>JSP&lt;/bodycontent>
    &lt;teiclass>com.solved.tag.dbtags.connection.ConnectionTEI&lt;/t
    eiclass>
    * &lt;info>Opens a connection based on a jndiName.&lt;/info>
    * &lt;attribute>
    * &lt;name>id&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    public class ConnectionTag extends TagSupport {
    static private OracleConnectionCacheImpl cache = null;
    public int doStartTag() throws JspTagException {
    try {
    Connection conn = null;
    if (cache == null) {
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup
    ("jdbc/pool/OracleCache");
    cache = (OracleConnectionCacheImpl)ds;
    catch (NamingException ne) {
    throw new JspTagException(ne.toString());
    conn = cache.getConnection();
    pageContext.setAttribute(getId(),conn);
    catch (SQLException e) {
    throw new JspTagException(e.toString());
    return EVAL_BODY_INCLUDE;
    package com.solved.tag.dbtags.connection;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    * <p>JSP tag closeconnection, used to close the
    * specified java.sql.Connection.<p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>closeConnection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.CloseConnectionTag&
    lt;/tagclass>
    * &lt;bodycontent>empty&lt;/bodycontent>
    * &lt;info>Close the specified connection. The "conn"
    attribute is the name of a
    * connection object in the page context.&lt;/info>
    * &lt;attribute>
    * &lt;name>conn&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    * @see ConnectionTag
    public class CloseConnectionTag extends TagSupport {
    private String _connId = null;
    * The "conn" attribute is the name of a
    * page context object containing a
    * java.sql.Connection.
    * @param connectionId
    * attribute name of the java.sql.Connection to
    close.
    * @see ConnectionTag
    public void setConn(String connectionId) {
    _connId = connectionId;
    public int doStartTag() {
    try {
    Connection conn = (Connection)pageContext.getAttribute
    (_connId);
    conn.close();
    } catch (SQLException e) {
    // failing to close a connection is not fatal
    e.printStackTrace();
    return EVAL_BODY_INCLUDE;
    public void release() {
    _connId = null;
    package com.solved.tag.dbtags.connection;
    import javax.servlet.jsp.tagext.TagData;
    import javax.servlet.jsp.tagext.TagExtraInfo;
    import javax.servlet.jsp.tagext.VariableInfo;
    * TagExtraInfo for the connection tag. This
    * TagExtraInfo specifies that the ConnectionTag
    * assigns a java.sql.Connection object to the
    * "id" attribute at the end tag.
    * @author Matt Shannon
    * @see ConnectionTag
    public class ConnectionTEI extends TagExtraInfo {
    public final VariableInfo[] getVariableInfo(TagData data)
    return new VariableInfo[]
    new VariableInfo(
    data.getAttributeString("id"),
    "java.sql.Connection",
    true,
    VariableInfo.AT_END
    data-sources.xml:
    <?xml version="1.0"?>
    <!DOCTYPE data-sources PUBLIC "Orion data-
    sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
    <data-source
    class="oracle.jdbc.pool.OracleConnectionCacheImpl"
    name="jdbc/pool/OracleCache"
    location="jdbc/pool/OracleCache"
    url="jdbc:oracle:thin:@oracle1:1521:pdev"
    >
    <property name="maxLimit" value="15" />
    <property name="cacheScheme" value="2" />
    <property name="user" value="console" />
    <property name="password" value="console" />
    <description>
    This DataSource is using an Oracle-native DataSource Class so as
    to allow Oracle Specific extensions.
    A getConnection() call on this DataSource will return
    oracle.jdbc.driver.OracleConnection.
    The connection returned is a logical connection.
    The caching scheme in place is Fixed Wait. Refer below to
    possible values.
    Dynamic 1
    Fixed Wait 2
    Fixed Return Null 3
    </description>
    </data-source>
    </data-sources>
    many thanks,
    Matt.

    Hi. Show me your pool definition.
    Joe
    Ramamurthy wrote:
    I am using the jsp custom tag library from BEA called sqltags.tld which came with Weblogic 5.1. Currently I am using Weblogic6.1 sp2 on Solaris.
    I have created a Connection Pool for Sybase database using the driver com.sybase.jdbc.SybDriver.
    When I created jsp page to connect to the connection pool using sqltags custom tag library, I am getting the error
    "javax.servlet.jsp.JspException: Failed to write body content
    at weblogic.taglib.sql.ConnectionTag.doAfterBody(ConnectionTag.java:43)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:1014)"
    After this message, whenever I try to access the same jsp page I am getting the message
    "javax.servlet.jsp.JspException: Failed to load JDBC driver: weblogic.jdbc.pool.D
    river
    at weblogic.taglib.sql.ConnectionTag.doStartTag(ConnectionTag.java:34)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:205)".
    Can you please help me the reason why this problem is happening and how to fix this ?
    This problem doexn't happen consistently. This occurs once in a while.
    I tried to increase Login delay Seconds parameter in the Connection Pool to 15 sec. It didn't help me much.
    Thanks for your help !!!
    Ram

  • MS Access and JSP

    I"ll really appreciate if someone could help me here. I'm new to JSP's and am having some trouble with database connection. I have one html page which asks the user to enter three fields and then submit it by clicking on the submite button(which calls add.jsp).
    The add.jsp contains the following code:
    Connection con=null;
    Statement stmt = null;
    ResultSet rs = null;
    String queryText = "insert into networks2 values('";
    queryText = queryText.concat(request.getParameter("SenderName"));
    queryText = queryText.concat("','");
    queryText = queryText.concat(request.getParameter("MessageTitle"));
    queryText = queryText.concat("','");
    queryText = queryText.concat(request.getParameter("MessageText"));
    queryText = queryText.concat("')");
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:networks2");
    stmt = con.createStatement();
    rs = stmt.executeQuery(queryText);
    } catch (Exception e) {}
    %>
    My problem is that the above data is not being inserted in the database. I have added networks2.mdb driver in system DSn. Could anyone please help me as to why i am not able to add information in my database.
    Thanks.

    Go over to the JDBC forum (which would have been a better place for your question, actually). The question "When I add a record to MS Access, it doesn't show up, why?" is asked frequently there. I think the answer is that it does show up if you continue by doing a select query, but I may be wrong.

  • JSP Best Practices and Oracle Report

    Hello,
    I am writing an application that obtains information from the user using a JSP/HTML form and then submitted to a database, the JSP page is setup using JSP Best Practices in which the SQL statments, database connectivity information, and most of the Java source code in a java bean/java class. I want to use Oracle Reports to call this bean, and generate a JSP page displaying the information the user requested from the database. Would you please offer me guidance for setting this up.
    Thank you,
    Michelle

    JSP Best Practices.
    More JSP Best Practices
    But the most important Best Practice has already been given in this thread: use JSP pages for presentation only.

  • Ideas pls for a small application on java and jsp?

    hi ,
    I would like to create an application which for resume. I would like to codify the java code . The java code should be able to autogenerate jsp file's since the output of the resume would be on an jsp page. To add it simply a wizard for dynamic resume creation using java swings and jsp. Code for jsp should be autogenerated please note it.
    Ideas please!
    Thanks in advance

    I'd like to add more information to Patreck's suggestion.
    JSP pages are wonderful if you need the web server to perform some actions before sending you the final web page.
    Here, you don't need the web server to do anything because your Swing application can do it for you. As Patreck implies, Swing can make a connection to the database, retrieve any information you want, perform whatever logic you need, and write the output to an HTML file.
    To give you an example, you can use Internet Explorer to view a basic web page on your hard disk. You can also use Microsoft Word to view the same basic web page. They both do the same task and there is no need to force IE to use its Word plug-in in order to view the web page.
    JSPs are not necessary because Swing will do all of the work for you. You only need JSPs if you want people to use your program through a web browser because they can't do Swing inside a web browser. You should only use one or the other, not both. Understand now?
    If you really really must generate JSP code from a Swing application, then just write out the JSP stuff in the file. For example...
    public void createWebPage( Printwriter pw, String myName ) {
       pw.println( "<% String myJSPName = \"" + myName + "\" %>" );
       pw.println( "<HTML>");
       pw.println( "<HEAD>");
       pw.println( "<TITLE>My Resume</TITLE>" );
       pw.println( "</HEAD>");
       pw.println( "<BODY>" );
       pw.println( "<H1>My name is " + myName + " and my JSP name is <%= myJSPName %></H1>" );
       pw.println( "</BODY>" );
       pw.println( "</HTML>" );
    }As you can see, it's pointless to embed JSP when you can do all the programming within Swing first and just write out the correct response.

  • JDeveloper and JSP 1.1

    Hallo,
    I'm using JDeveloper 3.1 for my JSP projects.
    This version of the product was deployed with OracleJSP (ojsp.jar) version 1.0.
    Now, I have the need to use some JSP 1.1 feature, but I have found no hints (Technet, Metalink) to upgrade OracleJSP at version 1.1. I downloaded 3.1.1.2, but this version have not JSP 1.1 support,too.
    I discovered that iAS 1.0.1 I downloaded and tried is deployed with OracleJSP 1.1.
    I copied libraries ojsp.jar and ojsputil.jar from iAS to JDeveloper\lib (before I backuped my original ojsp.jar).
    I tried with a simple JSP test application and all seemed ok.
    But, when I tried with a production application I had this problem: some pages weren't compiled with this error:
    "JDeveloper could not insert new character. 1024 line limit exceeded"
    Apparently my jsp pages seemed to be syntattically correct. Also, there was a page with .jsp suffix, but integrally composed of HTML (no scriptlet).
    Well I checked the .java generated from jsp and I discovered than OracleJSP 1.1 compiler has a different behaviour from the same one in release 1.0.
    Pratically, OracleJSP 1.0 compiler generate an istruction out.println("...") for every text line in a JSP page.
    OracleJSP 1.1 compiler generates an entry in an array char text[][] for every block in a JSP page, where a block is a sequence of istructions separated by scriptlet marks (<%...%>).
    Then for every block there is a corresponding out.print(...).
    What happens ? It's simple. If I have a flat HTML jsp page, I have only a "one line structure" text[0] and if all text is greater than 1024 characters, JDeveloper generate a compile error.
    The same happens if I have blocks of text or scriplets greater than 1024 chars.
    A simple workaround is to insert an empty scriptlet block <% %> between blocks too long, but I don't like this!
    Well, could anyone help me ?
    Is there an official Oracle upgrade to JDeveloper, so I could use JSP1.1 features ?
    Thanks.
    G.Grimoldi
    Satis s.r.l.

    fyi --
    i found the following by searching this forum ....
    from a sept 14th posting by the jdev team ...
    Hi,
    This is a good question that you ask and I am glad to say that JDeveloper 3.2 which should be available sometime in November, will be fully J2EE compliant in that we will support JSP 1.1 (with taglibs), Servlet 2.2 and EJB 1.1.
    Thanks,
    -Kishore
    null

  • Hi frnds i want to help in servlet,java bean and JSP

    hi friends i'm right now in M.SC(IT) and i want to do project in SERVLET,,JAVA BEANS and JSP ,
    so pls give me a title about that
    NOTE: I develop a project in group(2 persons there)
    my email id is : [email protected] , [email protected] , [email protected]

    You cannot pair your iPod to a cell phone, so forget about it.
    The only way you can get free WiFi is to hang out at a Denny's, a Starbucks, or a truck stop, and I don't think your parents would approve....

  • JFreechart and JSP, DefaultCategoryDataset is not identified

    Hi,
    Im using JFreechart in my application. Im just using a simple cahrt 2 check. If it works fine then i wil b apple to develop mi entire application. But i face the following problem. I placed al the jar files of JFreechart in root/webinf/lib/ but then DefaultCategoryDataset is not being identified. Can anyone please guide me whats the problem is?
    I hv enclosed the coding and the error with this mail.
    <%@page contentType="text/html;charset=big5"%>
    <%@page import="org.jfree.data.*"%>
    <%@page import="org.jfree.chart.*"%>
    <%@page import="java.io.*"%>
    <FORM METHOD="POST" name="chartform" action="Chart.jsp">
    <%
    DefaultCategoryDataset myDataSet=new DefaultCategoryDataset();
    myDataSet.setValue("apple",100);
    myDataSet.setValue("pear",200);
    myDataSet.setValue("grape",300);
    myDataSet.setValue("bannana",400);
    myDataSet.setValue("orange",500);
    JFreeChart chart=ChartFactory.createPieChart3D("fruit production chart",myDataSet,true,true,true);
    chart.setBackgroundPaint(java.awt.Color.white);
    chart.setBorderVisible(false);
    %>
    <img src="servlet/showChart" border=0>
    <Center><Input type="Submit" value="Generate..."/></Center>
    </FORM>
    </BODY>
    </HTML>
    -----------showChart code------------------
    import java.io.*;
    import javax.servlet.*;
    import org.jfree.data.*;
    import org.jfree.chart.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    public class showChart extends HttpServlet
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    ChartRenderingInfo thisImageMapInfo=new ChartRenderingInfo();
    HttpSession thisSession = request.getSession();
    response.setContentType("image/jpeg");
    JFreeChart thisChart=(JFreeChart)thisSession.getAttribute("chart");
    ChartUtilities.writeChartAsJPEG(response.getOutputStream(),100,thisChart,400,300,thisImageMapInfo);
    I have placed both the files in same folder. and complied the class. Is it enuf or whats the procedure to connect JSP and its correspondibg servlet.
    ----------------error--------------------------
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 15 in the jsp file: /Teresa/Chart.jsp
    Generated servlet error:
    DefaultCategoryDataset cannot be resolved or is not a type
    An error occurred at line: 15 in the jsp file: /Teresa/Chart.jsp
    Generated servlet error:
    DefaultCategoryDataset cannot be resolved or is not a type
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         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)
    any help is appreciated...thanks in advance
    Regards,
    Carry.

    sorry, I path name i hv specified is having some typo
    error
    but the jar files are in right path as said by u
    anything else to help me...yes, you havent imported the package
    <%@page import="org.jfree.data.category.*"%>Importing org.jfree.data.* doesnt import the sub-packages :)
    cheers,
    ram.

  • How to send group SMSes by using KvanttiSMS and JSP

    Hello again , I would want some help in implementing an SMS module that sends out a SMS message to a selected group of individuals from a database of several different groups .
    Now I have done a JSP GUI to allow the user to send a single SMS to one person .
    And my initial JSP codings for the Group SMS GUI were scrutinized and was said to be not functional by my lecturer .
    This is one of the technique that I know currently to send out an SMS :
    Connect to the database and get all the names of the groups .
    Using a while(column.next()) statement , the results will be placed into a drop down list in the JSP.
    The user selects the group from the drop down list and types the message as normal .
    The user presses the submit button and goes to the next JSP page (the 2nd JSP page sends out the SMS).
    The 2nd JSP page gets the group parameter and the message . Both parameters are placed into a string object.
    Using the string "group" object , another connection to the database is called .
    The database is called once again to retrieve handphone numbers that belong to groups that matches the string "group" object.
    using another while(column.next()) statement . The Sms terminal is called , initialized and used to send the message accordingly to the number of results .
    So is there any comment about this ? Please tell me what I should do if my method is wrong.

    I'm sorry ,
    actually the SQL statement uses the string "group" object to retrieve handphone numbers that belong to a person who is inside the same group as the string "group" object .

Maybe you are looking for

  • Tax statement item missing for tax code A0

    I got intercompany billing that has not been released to accounting, when I tried to release to accounting got this error message : Field Profit Ctr is a required field for G/L account 6000 14112100 Message no. F5808 Diagnosis The value for field "Pr

  • My serial number wont work when reinstalling the software.

    I recently reinstalled Ai CS3 and my serial number is not working. Anyone have an idea as to why?

  • Can i record with more than one audio interface

    I need to record 16 tracks, I have two different audio iterface, in GarageBand i can only find one of them, if i go to prefrenses-audio, I can set any of them as my audio interface, but only one at the time. Any tips to how I can use bouth simultanio

  • Digital Waveform graph with a lot of samples

    Hi, I have to display in a Digital Waveform Graph a lot of data read from a file(2.000.000 of samples for 36 signals). If I read the file and I try to display all the data, the Vi became unusable. For example, to zoom a graph region, it may take 30-4

  • When I open an item/link in a new tab, the new tab doesn't reflect the appropriate url

    When I open a new tab, the url reflects the old tab. For example, I downloaded the addon that allows you to determine what the new tab will display. I picked google. Well, google, opens alright, but the new URL reflects Yahoo.com, which is where I WA