ValueBound() valueUnbound() for every jsp:setProperty .../

Hi.
          My helper class (implementing HttpSessionBindingListener) is put into
          the HttpServletSession.
          What I want is valueBound()/valueUnbound() on creation/deletion of the
          session.
          The following code:
          <jsp:useBean id="usession" scope="session"
          class="net.icteam.frame.session.UserSession"/>
          <jsp:setProperty name="usession" property="httpRequest"
          value="<%=request%>"/>
          <jsp:setProperty name="usession" property="httpResponse"
          value="<%=response%>"/>
          fires a valueBound()/valueUnbound() for every(!) <jsp:setProperty.../>
          My Question:
          Is this normal behaviour?
          Btw, the following code behaves normal(?):
          <jsp:useBean id="usession" scope="session"
          class="net.icteam.frame.session.UserSession"/>
          <%
          usession.setHttpRequest(request);
          usession.setHttpResponse(response);
          %>
          regards,
          Roman
          

Sounds like the correct behavior to me. Is there some specific thing that
          you are trying to do?
          Peace,
          Cameron Purdy
          Tangosol Inc.
          << Tangosol Server: How Weblogic applications are customized >>
          << Download now from http://www.tangosol.com/download.jsp >>
          "Roman Heinz" <[email protected]> wrote in message
          news:[email protected]...
          > Hi.
          >
          > My helper class (implementing HttpSessionBindingListener) is put into
          > the HttpServletSession.
          >
          > What I want is valueBound()/valueUnbound() on creation/deletion of the
          > session.
          >
          > The following code:
          >
          > <jsp:useBean id="usession" scope="session"
          > class="net.icteam.frame.session.UserSession"/>
          > <jsp:setProperty name="usession" property="httpRequest"
          > value="<%=request%>"/>
          > <jsp:setProperty name="usession" property="httpResponse"
          > value="<%=response%>"/>
          >
          > fires a valueBound()/valueUnbound() for every(!) <jsp:setProperty.../>
          >
          > My Question:
          >
          > Is this normal behaviour?
          >
          >
          > Btw, the following code behaves normal(?):
          > <jsp:useBean id="usession" scope="session"
          > class="net.icteam.frame.session.UserSession"/>
          > <%
          > usession.setHttpRequest(request);
          > usession.setHttpResponse(response);
          > %>
          >
          > regards,
          > Roman
          

Similar Messages

  • Do we write one model bean for every JSF UI page?

    First, Please excuse my minimal knowledge in JSF, I am just starting to crawl :)
    Is my understanding about JSF that you will be writing one model bean class for every JSP page you have, CORRECT? (this is just my understanding, I may be wrong)
    This will be getting hard for large application.
    Ideal scenario: Say you have a JSP page A.jsp to associate an action reference you write a model bean class and have appropriate get method to return an Action object.
    Can we write an Action class, separated from the model bean class. I tried to create 2 different packages and one which just had a simple model bean and the other package had a Action class. I was not able to get this working as it was bouncing back with a Method innovation/Illegal argument exceptions. I am very confused here is it a necessity to write the action method in model bean or can we separate it? If we can separate it can we package it in to different packages?
    I may be confusing in explaining my questions but to put it black and white
    A)
    1 JSP Page (uses JSF components) = 1 model bean class (?)
    or
    B)
    1..n JSP pages (uses JSF components) = 1 or may be 2 model bean class (?)
    If B is possible how do we get the action classes towards this architecture and how can we get access to the various model bean objects in a single action class.
    Sorry for my vagueness....
    Thanks
    Ram

    In the particular case of your separate Action class,
    you still need a getter method for it somewhere. I
    find it easiest to include this getter in the same
    model bean that contains the data, but it doesn't have
    to be. Craig,
    It seems to be the consensus that a getter is required, but I've had perfect luck registering a single Action class in the application scope:
    <managed-bean>
      <managed-bean-name>fooAction</managed-bean-name>    
      <managed-bean-class>org.bar.FooAction</managed-bean-class>
      <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>And then referencing it directly:
    <h:command_button commandName="foo" actionRef="fooAction"/>This feels more like the Struts approach to me, as there's a single instance available. (If I wanted thread saftey, however, I could declare it in the request scope instead). I use this approach when there's no data associated with the Action (like a LogoutAction).
    Kito D. Mann

  • Binding="#{Page....}" for every component?

    Hi all,
    I've just been giving JSC 2ea2 a test drive for the first time and am very impressed.
    It seems that JSC uses a Java bean for every JSP page, and UI* attibributes for each component on the page. Is there any way to change this behaviour? I'm not sure I see the need to have a binding for each component - I've never needed any of these for the JSF apps which I've developed by hand.
    Is it an IDE requirement? Best practises? (eep!)
    Thanks in advance.
    Roger

    Hi,
    Please post messages related to Creator 2 EA at the feedbacks programs portal. The URL is:
    https://feedbackprograms.sun.com/login.html
    Thanks,
    Rk.

  • WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files

    I have a small custom tag library of three tag files. With the server running in development mode and the tag files in a JAR (included in WEB-INF/lib), the server appears to be doing a JSP recompile on every page load. However, it only compiles on the first page load if the tag files are included in WEB-INF/tags (no JAR). Also, running the server in production mode with the JAR'ed tag files avoids the recompile for every page load.
              Is that how the server should behave?
              For whatever it's worth, I'm also using Eclipse 3.3.2 with WTP and WebLogic Server Tools 1.1.2. The server is running the Sun JVM (1.5_10).

    Vikram,
              I went back and created a simple example to test. Below I'm posting the Java source code generated from the two relevant files: index.jsp, and hello.tag.
              __index.java:
              package jsp_servlet;
              import java.io.*;
              import java.util.*;
              import javax.servlet.*;
              import javax.servlet.http.*;
              import javax.servlet.jsp.*;
              import javax.servlet.jsp.tagext.*;
              public final class __index extends weblogic.servlet.jsp.JspBase implements weblogic.servlet.jsp.StaleIndicator {
              private static void _releaseTags(javax.servlet.jsp.tagext.JspTag t) {
              while (t != null) {
              if(t instanceof javax.servlet.jsp.tagext.Tag) {
              javax.servlet.jsp.tagext.Tag tmp = (javax.servlet.jsp.tagext.Tag)t;
              t = ((javax.servlet.jsp.tagext.Tag) t).getParent();
              try {
              tmp.release();
              } catch(Exception ignore) {}
              else {
              t = ((javax.servlet.jsp.tagext.SimpleTag)t).getParent();
              public boolean _isStale(){
              boolean stale = staticIsStale((weblogic.servlet.jsp.StaleChecker) getServletConfig().getServletContext());
              return _stale;
              public static boolean _staticIsStale(weblogic.servlet.jsp.StaleChecker sci) {
              if (sci.isResourceStale("/index.jsp", 1207926672370L ,"9.2.2.0","America/Denver")) return true;
              if (sci.isResourceStale("/null", 1207926783245L ,"9.2.2.0","America/Denver")) return true;
              return false;
              private static void _writeText(javax.servlet.ServletResponse rsp, javax.servlet.jsp.JspWriter out, String block, byte[] blockBytes)
              throws java.io.IOException {
              if (!_WL_ENCODED_BYTES_OK || _hasEncodingChanged(rsp)){
              out.print(block);
              } else {
              ((weblogic.servlet.jsp.ByteWriter)out).write(blockBytes, block);
              private static boolean _hasEncodingChanged(javax.servlet.ServletResponse rsp){
              String encoding = rsp.getCharacterEncoding();
              if ( "ISO-8859-1".equals(encoding) || "Cp1252".equals(encoding) || "ISO8859_1".equals(encoding) || "ASCII".equals(encoding) ){
              return false;
              if (_WL_ORIGINAL_ENCODING.equals(encoding)) {
              return false;
              return true;
              private static boolean WLENCODED_BYTES_OK = true;
              private static final String WLORIGINAL_ENCODING = "ISO-8859-1";
              private static byte[] _getBytes(String block){
              try {
              return block.getBytes(_WL_ORIGINAL_ENCODING);
              } catch (java.io.UnsupportedEncodingException u){
              WLENCODED_BYTES_OK = false;
              return null;
              private final static String wlblock0 ="<!--\n * $Id$\n-->\n \n<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \n\t\t\"http://www.w3.org/TR/html4/loose.dtd\">\n \n";
              private final static byte[] wlblock0Bytes = getBytes( wl_block0 );
              private final static String wlblock1 =" \n \n\t";
              private final static byte[] wlblock1Bytes = getBytes( wl_block1 );
              private final static String wlblock2 ="\n";
              private final static byte[] wlblock2Bytes = getBytes( wl_block2 );
              private final static String wlblock3 ="\n\n<html>\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" />\n\n\t<title>Tag File Test</title>\n</head>\n<body> \n\t";
              private final static byte[] wlblock3Bytes = getBytes( wl_block3 );
              private final static String wlblock4 ="\n</body>\n</html>";
              private final static byte[] wlblock4Bytes = getBytes( wl_block4 );
              static private javelin.jsp.JspFunctionMapper jspxfnmap = javelin.jsp.JspFunctionMapper.getInstance();
              public void _jspService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException, java.io.IOException {
              javax.servlet.ServletConfig config = getServletConfig();
              javax.servlet.ServletContext application = config.getServletContext();
              javax.servlet.jsp.tagext.JspTag _activeTag = null;
              Object page = this;
              javax.servlet.jsp.JspWriter out;
              javax.servlet.jsp.PageContext pageContext = javax.servlet.jsp.JspFactory.getDefaultFactory().getPageContext(this, request, response, null, true , 8192 , true );
              response.setHeader("Content-Type", "text/html; charset=ISO-8859-1");
              out = pageContext.getOut();
              javax.servlet.jsp.JspWriter _originalOut = out;
              javax.servlet.http.HttpSession session = request.getSession( true );
              try {;
              response.setContentType("text/html; charset=ISO-8859-1");
              {_writeText(response, out, _wl_block0, _wl_block0Bytes);}
              {_writeText(response, out, _wl_block1, _wl_block1Bytes);}
              {_writeText(response, out, _wl_block2, _wl_block2Bytes);}
              {_writeText(response, out, _wl_block3, _wl_block3Bytes);}
              jsp_servlet._tags.__hello_tag __tag0 = null ;
              int __result__tag0 = 0 ;
              if (__tag0== null )__tag0 = new jsp_servlet._tags.__hello_tag ();
              __tag0.setJspContext(pageContext);
              __tag0.setParent(null);
              activeTag=_tag0;
              __tag0.doTag();
              {_writeText(response, out, _wl_block4, _wl_block4Bytes);}
              } catch (Throwable __ee){
              if(!(__ee instanceof javax.servlet.jsp.SkipPageException)) {
              while ((out != null) && (out != _originalOut)) out = pageContext.popBody();
              releaseTags(activeTag);
              pageContext.handlePageException(__ee);
              __hello_tag.java:
              package jsp_servlet . _tags ;
              import java.io.*;
              import java.util.*;
              import javax.servlet.*;
              import javax.servlet.http.*;
              import javax.servlet.jsp.*;
              import javax.servlet.jsp.tagext.*;
              public final class __hello_tag extends javax.servlet.jsp.tagext.SimpleTagSupport {
              private static void _releaseTags(javax.servlet.jsp.tagext.JspTag t) {
              while (t != null) {
              if(t instanceof javax.servlet.jsp.tagext.Tag) {
              javax.servlet.jsp.tagext.Tag tmp = (javax.servlet.jsp.tagext.Tag)t;
              t = ((javax.servlet.jsp.tagext.Tag) t).getParent();
              try {
              tmp.release();
              } catch(Exception ignore) {}
              else {
              t = ((javax.servlet.jsp.tagext.SimpleTag)t).getParent();
              public static boolean _staticIsStale(weblogic.servlet.jsp.StaleChecker sci) {
              if (sci.isResourceStale("/META-INF/tags/hello.tag", 1207926783175L ,"9.2.2.0","America/Denver")) return true;
              return false;
              protected static final String tagxTagInfo = "-84,-19,0,5,116,0,5,104,101,108,108,111,116,0,29,106,115,112,95,115,101,114,118,108,101,116,46,95,116,97,103,115,46,95,95,104,101,108,108,111,95,116,97,103,116,0,5,101,109,112,116,121,112,112,112,112,119,5,0,0,0,0,3,116,0,10,106,115,112,67,111,110,116,101,120,116,119,1,0,116,0,28,106,97,118,97,120,46,115,101,114,118,108,101,116,46,106,115,112,46,74,115,112,67,111,110,116,101,120,116,113,0,126,0,4,119,1,1,112,119,2,1,0,112,112,116,0,7,106,115,112,66,111,100,121,119,1,0,116,0,36,106,97,118,97,120,46,115,101,114,118,108,101,116,46,106,115,112,46,116,97,103,101,120,116,46,74,115,112,70,114,97,103,109,101,110,116,113,0,126,0,6,119,1,1,112,119,2,1,0,112,112,116,0,6,112,97,114,101,110,116,119,1,0,116,0,31,106,97,118,97,120,46,115,101,114,118,108,101,116,46,106,115,112,46,116,97,103,101,120,116,46,74,115,112,84,97,103,113,0,126,0,8,119,1,1,112,119,2,1,0,112,112,119,4,0,0,0,0,112,112,";
              protected JspContext jspContext ;
              public void setJspContext ( JspContext ctx ){
              super . setJspContext ( ctx );
              java.util.List nested = null ;
              java.util.List atBegin = null ;
              java.util.List atEnd = null ;
              this.jspContext = new javelin.jsp.JspContextWrapper(ctx, nested, atBegin, atEnd, null);
              }public JspContext getJspContext() {
              return this.jspContext;
              private java.io.Writer jspxsout;
              private javax.servlet.jsp.tagext.JspTag _activeTag;
              private static void _writeText(javax.servlet.ServletResponse rsp, javax.servlet.jsp.JspWriter out, String block, byte[] blockBytes)
              throws java.io.IOException {
              if (!_WL_ENCODED_BYTES_OK || _hasEncodingChanged(rsp)){
              out.print(block);
              } else {
              ((weblogic.servlet.jsp.ByteWriter)out).write(blockBytes, block);
              private static boolean _hasEncodingChanged(javax.servlet.ServletResponse rsp){
              String encoding = rsp.getCharacterEncoding();
              if ( "ISO-8859-1".equals(encoding) || "Cp1252".equals(encoding) || "ISO8859_1".equals(encoding) || "ASCII".equals(encoding) ){
              return false;
              if (_WL_ORIGINAL_ENCODING.equals(encoding)) {
              return false;
              return true;
              private static boolean WLENCODED_BYTES_OK = true;
              private static final String WLORIGINAL_ENCODING = "ISO-8859-1";
              private static byte[] _getBytes(String block){
              try {
              return block.getBytes(_WL_ORIGINAL_ENCODING);
              } catch (java.io.UnsupportedEncodingException u){
              WLENCODED_BYTES_OK = false;
              return null;
              private final static String wlblock0 ="\n<center><h1>Hello World</h1></center>";
              private final static byte[] wlblock0Bytes = getBytes( wl_block0 );
              static private javelin.jsp.JspFunctionMapper jspxfnmap = javelin.jsp.JspFunctionMapper.getInstance();
              public void doTag() throws JspException, java.io.IOException {
              javax.servlet.jsp.PageContext pageContext = (javax.servlet.jsp.PageContext) getJspContext();
              javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest) pageContext.getRequest ();
              javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse) pageContext.getResponse();
              javax.servlet.http.HttpSession session = pageContext.getSession();
              javax.servlet.ServletContext application = pageContext.getServletContext();
              javax.servlet.ServletConfig config = pageContext.getServletConfig();
              javax.servlet.jsp.JspWriter out = jspContext.getOut();
              javax.servlet.jsp.tagext.JspTag _activeTag = null;
              try {
              {_writeText(response, out, _wl_block0, _wl_block0Bytes);}
              } catch ( Throwable t ){
              if( t instanceof javax.servlet.jsp.SkipPageException )
              {throw (javax.servlet.jsp.SkipPageException)t;}
              if( t instanceof java.io.IOException )
              {throw (java.io.IOException)t;}
              if( t instanceof IllegalStateException )
              {throw (IllegalStateException)t;}
              if( t instanceof javax.servlet.jsp.JspException )
              {throw (javax.servlet.jsp.JspException)t;}
              throw new javax.servlet.jsp.JspException(t);
              finally {
              ((javelin.jsp.JspContextWrapper)jspContext).syncEndTagFile();
              Edited by Stephen Davison at 04/11/2008 9:02 AM

  • How can I keep the name of the user around for each JSP without asking user

    I have a number of JSP pages that I give the user access to once they login successfully. I want to be able to keep the name of the user present on every page without having to ask them for it each time.
    How can I do this? Currently I have a user object that is access through use of a request bean in my JSP's.
    Any suggestions???

    Thanks for the help. A few questions though...
    Can you just clarify how the 2 different SessionTest2.jsp's differ. I am right in thinking that the second one will instantiate a new bean object which if I do every time I go to the page, I will be getting the same name but in a different session each time. In the first SessionTest.jsp, I get the same name but from the same session object each time??
    Please clarify???
    SessionTest1.jsp
    <%@ page language="java" import="test.*" %>
    <jsp:useBean id="testBean" scope="session"
    class="test.TestBean" />
    <jsp:setProperty name="testBean" property="name"
    value="ZZZZZ" />
    <jsp:setProperty name="testBean" property="status"
    value="Married" />
    <%
         response.sendRedirect("SessionTest2.jsp");
         return;
    %>
    SessionTest2.jsp
    <%@ page import="test.*" %>
    <jsp:useBean id="testBean" scope="session"
    class="test.TestBean" />
    <%
    out.println("User Name is : "+testBean.getName());
    %>or SessionTest2.jsp
    <%@ page import="test.*" %>
    <jsp:useBean id="testBean" scope="session"
    class="test.TestBean" />
    <%
    TestBean testBean =
    (TestBean)session.getAttribute("testBean");
         out.println("Name is : "+testBean.getName());
    %>Hope this helps.
    Sudha

  • 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).

  • WAR - how to continue compiling even when compile fails for some jsp's

    i am trying to pre-compile all my jsp's and find out all the compilation
              errors in all the jsp's..
              i am defining a war app and i am making the weblogic server to precompile
              the jsp's.. i control this from web.xml
              the problem is
              weblogic starts compiling the jsp's and when it hits the first error it
              bails out.. i doesn't precompile the rest of the jsp's..
              how do i make weblogic server to continue compiling the rest of the jsp's??
              anyone??
              

    You sure can run a Windows Form and while it is visible, run code in the Powershell script, and communicate the information from the 'main' script  to the form.
    To do this you need create a separate Powershell runspace and dependent on situation either use shared memory and timer in the form or delegates to directly call form elements
    Please check my article at codeproject for extensive journey of using all core Windows Forms, WPF, Selenium with Powershell for tasks which often require various option prompts.
    http://www.codeproject.com/Articles/799161/Dealing-with-Powershell-Inputs-via-Basic-Windows-F
    You find there over 40 common Windows form patterns  ( prompts, grids, check/radio boxes, progress bars of many forms, tree views, item lists, passwords, tool tips, system tray widgets, browser controls, examples of using p/invoke, hosting custom controls,
    dealing with selenium webdriver, dealing with selenium-unfriendly file upload dialogs etc. ) all covered there - working code for every example is provided, and the code is hosted on github.
    Routine daily devops tasks of executing Powershell scripts in a complex environment suddenly become a less challenging task. Web scraping becomes more fun

  • Jsp:setProperty in WebLogic 6.0

    Hi,
              We are using the WebLogic Web container with the Apache server and we
              have encountered a problem with the <jsp:setProperty> and
              <jsp:getProperty> tags. We are using WebLogic 6.0sp1.
              Reading the newsgroups, I noticed that this tag did not work in the
              previous versions of WebLogic and I was wondering if it has been fixed
              in 6.0sp1. Here's the snippet of JSP page that I use:
              <jsp:useBean id="beanName" scope="session"
              class="com.imoney.aplications.BeanClass">
              <jsp:setProperty name="beanName" property="userId" value='<%=
              request.getParameter("userId") %>' />
              </jsp:useBean>
              The problem is that the property userId of the bean with name beanName
              is not set by this tag. The JSP page compiles properly. The bean
              instance beanName is unique in the user session context.
              Thank you for any help,
              Brenda.
              [att1.html]
              

    Hi,
              We are using the WebLogic Web container with the Apache server and we
              have encountered a problem with the <jsp:setProperty> and
              <jsp:getProperty> tags. We are using WebLogic 6.0sp1.
              Reading the newsgroups, I noticed that this tag did not work in the
              previous versions of WebLogic and I was wondering if it has been fixed
              in 6.0sp1. Here's the snippet of JSP page that I use:
              <jsp:useBean id="beanName" scope="session"
              class="com.imoney.aplications.BeanClass">
              <jsp:setProperty name="beanName" property="userId" value='<%=
              request.getParameter("userId") %>' />
              </jsp:useBean>
              The problem is that the property userId of the bean with name beanName
              is not set by this tag. The JSP page compiles properly. The bean
              instance beanName is unique in the user session context.
              Thank you for any help,
              Brenda.
              [att1.html]
              

  • Prob with jsp setProperty

    Dear fouramites,
    I am using jsp SetProperty standadr action tag to set from values to beans. In update when I am changing any form field value it is working fine but when I am deleting the form field value the previous value is being set to bean.
    What is the solution to this problem?
    Thanks & Regards
    Kavyaanjali Jena

    Dear Ram,
    I am using the following code for both save and update functionality.
    <html>
    <%@ page session="true"%>
    <%@ page language="java" %>
    <%@ page import="models.*"%>
    <%@ page import="beans.*"%>
    <%@ page import="java.util.*"%>
    <%
    <jsp:useBean id="DATA_MODEL" scope="session" type="models.BeanInterface" />
    <jsp:setProperty name="DATA_MODEL" property="*"/>
    <jsp:forward page="/servlet/FrontController" />
    </html>
    When I change the value This code could set value to bean but when I totally delete the value it could not set null to bean but old value is retained.
    I am using FrontController architecture.
    Thanks & Regards
    Kavyaanjali Jena

  • How to deal empty field with jsp:setProperty ...

    Ive come across a bug in what I've done so far, not sure if its because of my approach...
    I sucessfully store a value entered in a text field in a bean without any problems, and navigate back to the page where the value re-appears (via html, not relying on the browser). The problem is, if I edit that field to be blank, resubmit, then navigate back, the old value returns.
    As far as I can tell, this is due to my jsp interpreting the input as null (ie. no input) and not changing the tag. IE sends the parameter as myPage.jsp?para1=&para2=some+value as it should (where para1 is the input in question).
    I use the 'parameter="*"' usage of jsp:setProperty - is that a problem? Does this usage of setProperty not allow for setting values back to "" ? If so, how can i overcome this problem without losing the benefits of using <jsp:setProperty name="myBean" property="*">, that is, you can store all property values in javaBean in one go, instead of repeatly using <jsp:setProperty name="myBean" property="myProperty" value="myValue"> for each property.

    hi,
    first clearly tell u' r problem and then only any one can help u.
    we are not unable to understand u'r query. it's like a Composition.
    Bala
    Message was edited by:
    art84

  • Urgent I am begging for help: JSP Tables

    Hi All
    I am trying to bring back tables from my database. I am using mysql but I have this error:
    Error: 500 Location: /jspixwebapp/GetInfoFromDB.jspInternal Servlet Error:javax.servlet.ServletException
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
    at _0002fGetInfoFromDB_0002ejspGetInfoFromDB_jsp_9._jspService(_0002fGetInfoFromDB_0002ejspGetInfoFromDB_jsp_9.java:100)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
    at org.apache.tomcat.core.Handler.service(Handler.java:287)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
    at java.lang.Thread.run(Thread.java:484)
    Root cause: java.lang.NullPointerException
    at electronicstudent.GetInfoFromDBBean.runSql(GetInfoFromDBBean.java:58)
    at _0002fGetInfoFromDB_0002ejspGetInfoFromDB_jsp_9._jspService(_0002fGetInfoFromDB_0002ejspGetInfoFromDB_jsp_9.java:91)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
    at org.apache.tomcat.core.Handler.service(Handler.java:287)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
    at java.lang.Thread.run(Thread.java:484)
    I am using a bean to make the presentation layer: Here is the code:
    package electronicstudent;
    import java.sql.* ;
    import java.io.Serializable;
    //JavaBeans for server-side data processing
    //The bean builds the HTML for presentation.
    public class GetInfoFromDBBean implements java.io.Serializable {
    public GetInfoFromDBBean() {
    public String runSql (){
    String browserOutput = "";
    String connectionURL = ("jdbc:odbc:estudent");
    Connection conn = null;
    Statement stmt = null;
    ResultSet rs = null;
    String username = "root";
    String password = "";
    try{
    Class.forName("jdbc:odbc:estudent").newInstance();
    String myDatabase = "jdbc:odbc:JdbcOdbcDriver:157.190.176.120";
    conn = DriverManager.getConnection(connectionURL,username , password ) ;
    stmt = conn.createStatement();
    String sql ="select * from student" ;
    browserOutput ="<table border=3 align=center width=75%>" +
    "<caption><i><b>" +
    "Examination Results</b></i></caption>" ;
    browserOutput += "<th align=left>Username</th>" +"<th>Password</th>";
    while(rs.next()){
    browserOutput += "<TR><TD>" +
    rs.getObject("username").toString() + "</TD><TD>" +
    rs.getObject("password").toString()+"</TD><TD>" ;
    stmt.close();
    catch (SQLException e)
    browserOutput = " Error: SQL error of: " + e.getMessage();
    catch (Exception e)
    browserOutput = " Error: JDBC Class creation: " + e.getMessage();
    finally
    try
    conn.close();
    catch(SQLException e)
    browserOutput = " Error: Closing connection: " + e.getMessage();
    browserOutput += "</table>" ;
    return browserOutput;
    and here is the html code:
    <html>
    <head><title>GET INFORMATION FROM THE DATABASE </title></head>
    <body>
    <jsp:useBean id="GetInfoFromDB" scope="session" class="electronicstudent.GetInfoFromDBBean" />
    <jsp:setProperty name="GetInfoFromDB" property="*" />
    <% out.print ( GetInfoFromDB.runSql() ) ; %>
    </body>
    </html>
    Please help, I would really appreciate it.

    Class.forName("jdbc:odbc:estudent").newInstance();The Class.forName() should contain the location of your driver, not the URL of your database. Most likely it should read
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")

  • jsp:setProperty doesn't work with short properties

    Hi,
              Setting bean properties doesn't work with properties that are of type short.
              Any ideas what's going on? I'm using WLS 6.1SP1 on W2K.
              --John
              <jsp:useBean id="test" scope="session" class="test.Test" />
              <jsp:setProperty name="test" property="*" />
              -- Test.java
              package test;
              * @author john
              public class Test {
              /** Creates new Test */
              public Test() {
              public short getShort() {
              return 0;
              public void setShort(short val) {
              Produces the following error while attempting to compile the jsp:
              Compilation of
              'C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tmp
              warCleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java'
              failed:
              C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tmp_
              war_CleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java:104:
              setShort(short) in test.Test cannot be applied to ()
              probably occurred due to an error in /test.jsp line 7:
              <jsp:setProperty name="test" property="*" />
              C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tmp_
              war_CleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java uses or
              overrides a deprecated API.
              Full compiler error(s):
              C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tmp_
              war_CleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java:104:
              setShort(short) in test.Test cannot be applied to (<null>)
              test.setShort(null); //[ /test.jsp; Line: 7]
              ^
              Note:
              C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tmp_
              war_CleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java uses or
              overrides a deprecated API.
              Note: Recompile with -deprecation for details.
              1 error
              Fri Nov 09 00:24:58 PST 2001
              [test.war]
              

    It looks like a bug in JSP generator. If you look and the .java
              created by 6.1 it doesn't make any sence:
              String _propertyValue = request.getParameter("short");
              if (_propertyValue != null && !_propertyValue.equals(""))
              test.setShort(null);
              (needless to say that this works correctly in Resin).
              John Hampton <[email protected]> wrote:
              > Thanks for reply,
              > Changing getShort and setShort to getId and setId makes no difference. I
              > still get the error described below:
              > C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tmp_
              > war_CleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java:104:
              > setId(short) in test.Test cannot be applied to (<null>)
              > test.setId(null); //[ /test.jsp; Line: 7]
              > John
              > "Jignesh" <[email protected]> wrote in message
              > news:[email protected]...
              >>
              >> hi,
              >> i think you have not given the property name properly.
              >> give some other name than short becuase short is the keyword (data-type)in
              > java.
              >> bye,
              >> Jignesh
              >>
              >>
              >> "John Hampton" <[email protected]> wrote:
              >> >Hi,
              >> >
              >> >Setting bean properties doesn't work with properties that are of type
              >> >short.
              >> >Any ideas what's going on? I'm using WLS 6.1SP1 on W2K.
              >> >
              >> >--John
              >> >
              >> ><jsp:useBean id="test" scope="session" class="test.Test" />
              >> ><jsp:setProperty name="test" property="*" />
              >> >
              >> >-- Test.java
              >> >package test;
              >> >
              >> >/**
              >> > *
              >> > * @author john
              >> > */
              >> >public class Test {
              >> >
              >> > /** Creates new Test */
              >> > public Test() {
              >> > }
              >> >
              >> > public short getShort() {
              >> > return 0;
              >> > }
              >> >
              >> > public void setShort(short val) {
              >> > }
              >> >}
              >> >
              >> >Produces the following error while attempting to compile the jsp:
              >> >
              >> >Compilation of
              >>
              >>'C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tm
              > p
              >> >warCleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java'
              >> >failed:
              >>
              >>---------------------------------------------------------------------------
              > -
              >> >----
              >>
              >>C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tmp
              > _
              >> >war_CleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java:104:
              >> >setShort(short) in test.Test cannot be applied to ()
              >> >probably occurred due to an error in /test.jsp line 7:
              >> ><jsp:setProperty name="test" property="*" />
              >> >
              >>
              >>C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tmp
              > _
              >> >war_CleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java
              >> >uses or
              >> >overrides a deprecated API.
              >> >
              >>
              >>---------------------------------------------------------------------------
              > -
              >> >----
              >> >Full compiler error(s):
              >>
              >>C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tmp
              > _
              >> >war_CleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java:104:
              >> >setShort(short) in test.Test cannot be applied to (<null>)
              >> > test.setShort(null); //[ /test.jsp; Line: 7]
              >> > ^
              >> >Note:
              >>
              >>C:\bea\wlserver6.1\config\cleanoffer\applications\.wlnotdelete\WEB-INF\_tmp
              > _
              >> >war_CleanOffer Server_CleanOffer Server_test\jsp_servlet\__test.java
              >> >uses or
              >> >overrides a deprecated API.
              >> >Note: Recompile with -deprecation for details.
              >> >1 error
              >> >
              >> >
              >>
              >>---------------------------------------------------------------------------
              > -
              >> >----
              >> >Fri Nov 09 00:24:58 PST 2001
              >> >
              >> >
              >> >
              >> >
              >> >begin 666 test.war
              >> >M4$L#!!0`" `(`,@`:2L````````````````4``0`345402U)3D8O34%.249%
              >> >M4U0N34;^R@``X^4"`%!+!PBLA:(4! ````(```!02P,$% `(``@`R !I*P``
              >> >M``````````````\```!714(M24Y&+W=E8BYX;6RE4DMOVS ,/L^ _P/GTP9,
              >> >M4NH=M@YIBC3I@ )M&G3IAIX*1V9B!;)D6'0>WY2GDT6# /FD&1WX,4V]?+
              >> >M4L,<:Z>LN4HN>"L!--+FRDRODN?1=_8UN>[$4?L]8W$$)]^/QL"P&6LEX5Y)
              >> >M- YA8,G_Q5$<C0H$:0VA(0=V`E0H!Q.E$;(:P37C&4H"LKZ 9Y3BZ.<F%?A0
              >> >M\"$T)=M2\I'#BVV@S%9@+$'C?0_JN)18$2@31]*6E5:9D0@+1<7:::O!H>O3
              >> >M5:M-LCT,7B6;9TIGXQ"4XJ@@JKX)L5@LN&L,]Y)B-]UCK:;*9!IZ-E\S!T@W
              >> >MF!G'(93OC"+EJWV<H[85UCNO'2^.=L0P_H.2M74K1UBZ3YXL.0QM37X#SAM4
              >> >M*T\J""XN+[^PM-5J!4X<G2%UM8:GT.O@"1W6<\QY'#'6";'#2_8?>Z.7X2TL
              >> >M<,RRJMH\Z_#YYOZN!PD3XGP8(?JC/OS",70KOU29A620\E2(VT&R$4FVRYKY
              >> >M%>ZW-4L114ZY$UO#U_0UY1Y(UHG:6[2SD6@[=.'5F3^=B9IV#D>WKY JT3;4
              >> >M.;['SZTWK>)\[P$_4O<1M$^*+-P/T\J%_G='Z(F9,CDN^<Q5;SU/^O]!H*!2
              >> >M_[?"7P3^!'?3M<5A[;\!4$L'"/]33>'A`0``! 0``%!+`P04``@`" #(`&DK
              >> >M````````````````" ```'1E<W0N:G-P-4X[#L(P#-US"A.I"P/>D1LAQ,14
              >> >MB5X@M!84M4E4&XG>GJ:!R<_OIT?5*?D'0Q>#<M!V25Q;Y8_B4Z?15LY0!OFP
              >> >M[QWIH".[ZZV!9HT1EI]P4PW=8[\X8^@EZ?@6/K,/,/2Y4=2"=#'7"XL,,5CH
              >> >M1B]2Q$.[.="5K+ V\VJ>=8'@)_XW0/JQM=T7=W+F$@/O=H9PQ81E`F&9_050
              >> >M2P<(E)0WZYL```#@````4$L#!!0`" `(`,@`:2L````````````````?````
              >> >M5T5"+4E.1B]C;&%S<V5S+W1E<W0O5&5S="YC;&%S<TV/OT[#,!#&OTO2IDT+
              >> >M_4.I6-D*`C(@)A +$E,$0ZKN3K!:5R&1$K=/Q<*$Q, #\%"(LQ-%]7!W_MU]
              >> >MW]F_?]\_<'&-><#IQ,?,QRFA^Z!RI1\)[N)B1?">BC=)&$4JER^[]T262Y%D
              >> >M3*91D8IL)4IE[@WT]$95A$&D9:7#)8=[0F\M=;PI2FT]8P95"[Q%;+:X>Y$1
              >> >MB'M!7.S*5#XK8]<W#C=;L1=#>.@P:'T)8\/#3.3K\#79RE3C' [_Q!P79 0<
              >> >MNWR[Y4R<.Y=?H$\N'/@<`\[ F <GZ'$UK(?0YPZX'EAB#*X:`\?]:-5=2V8'
              >> >M2J=5'N&X4=Y9CL.UM?#,"N=ULQ&::L0/,LLF=G[Z#U!+!PA>>AD-#@$``*4!
              >> >M``!02P$"% `4``@`" #(`&DKK(6B% 0````"````% `$````````````````
              >> >M````345402U)3D8O34%.249%4U0N34;^R@``4$L!`A0`% `(``@`R !I*_]3
              >> >M3>'A`0``! 0```\`````````````````2@```%=%0BU)3D8O=V5B+GAM;%!+
              >> >M`0(4`!0`" `(`,@`:2N4E#?KFP```. ````(`````````````````&@"``!T
              >> >M97-T+FIS<%!+`0(4`!0`" `(`,@`:2M>>AD-#@$``*4!```?````````````
              >> >M`````#D#``!714(M24Y&+V-L87-S97,O=&5S="]497-T+F-L87-S4$L%!@``
              >> >0```$``0`!@$``)0$````````
              >> >`
              >> >end
              >> >
              >>
              Dimitri
              

  • Modify Collection with jsp:setproperty

    Hello:
    I have a problem with jsp and struts.
    I have a collection of items (List) and view the elments in jsp page. This It works fine.
    But the problem happens when i like modify the collection.
    The code to view the collection in jsp is:
    <jsp:useBean id="ItemListForm" class="com.myapp.struts.ItemListForm" scope="session" />
    <html:form action="/ItemEditAction" >
    <logic:iterate name="ItemListForm" property="listaItems" id="item" >
    <P>
    <BASEFONT SIZE="3">
    <jsp:getProperty name="item" property="etiqueta" />
    </BASEFONT>
    <P>
    <jsp:getProperty name="item" property="grafico"/>
    <P>
    </logic:iterate>
    <P>
    <html:submit>Save File</html:submit>
    <html:hidden property="do" value="saveXML"/>
    </html:form>
    The question is:
    How to modify the element "grafico" with jsp:setproperty.
    Thanks for all.

    Thank you, I had forgotten the set part, but then the next problem occurs:
    <jsp:setProperty name="date" property="locale" value="${locales.locale}"/>
    generates:
    org.apache.jasper.JasperException: Unable to convert string '${locales.locale}' to class java.util.Locale for attribute locale: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager
    could I only use Strings as input?

  • Need Help:  Problem with JSP setProperty to Bean

    Hi,
    This is my first time posting to this forum so I am not completely aware how Duke dollars work but if anybody can help me I will be happy to give some... whats normal for solving a problem?? 10??
    Anyway... the problem...
    I have a simple JSP with a simple HTML <form> that has a text field and a Submit button. Submit takes the user to the next JSP page however the setter method for property 'user' is never called. I can verify this through an attached debugger.
    I am using Tomcat 5.5, and I never had a problem like this in previous versions of Tomcat.
    I have tried changing the scope of the bean to request however nothing changed. I excluded all my business logic and tested this one more time just to make sure I wasn't inadvertadely screwing with something however this still does not work.
    I am sure I am missing something small but for the life of me I can't figure out what.
    Here is my code:
    index.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <jsp:useBean id="something" scope="session" class="com.db.servlet.UserBean">
                <jsp:setProperty name="something" property="*"/>
            </jsp:useBean>
            <p>Select</p>
            <form id="Form1" method="post" action="multi.jsp">
                <p>User: </p>
                <input type="text" name="user" size="20"><br>
                <input type="submit" value="Submit">
            </form>
        <br><p>Or select Single mode.</P><br>
        <a href="tris.html">tris</a>
        </body>
    </html>UserBean:
    package com.db.servlet;
    public class UserBean {
        private String user = null;
        public UserBean() {
        public void setUser(String user) {
            this.user = user;
        public String getUser() {
            return user;
    }

    Oops!
    I not only realized my mistake, I also accidentally posted this in the wrong forum. I meant to post in the JSP Forum.
    For reference, what I did wrong was I placed my setProperty tag in index.jsp rather than placing it in multi.jsp (the file specified in the form action).
    Everything works now.

  • Jsp:setProperty

    Well
    I like to use one bean for different jsps with different properties.
    I don't want to have setters and getters properties, I would like a HashMap with the property-values.
    Could I overwrite jsp:setProperty tag?
    Or it will be better to use a custom constructor with HTTPServletRequest param?
    Thanks

    Try the following forum (about JSP technology)
    http://forum.java.sun.com/forum.jspa?forumID=45

Maybe you are looking for

  • In ALV display model ,how to accept the ENTER key event?

    Dear All, I have used ALV by  GRID DISPLAY model ,not class model.     CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'     EXPORTING       i_callback_program       = sy-repid       i_callback_pf_status_set = 'SET_PF_STATUS'       i_callback_user_command  = 'U

  • Issues with limit/filter on outer join table in BQY

    I'm converting a series of BQY's from Brio 6.6 to Hyperion 9.3. I have some questions about the "use ODBC outer join syntax on limits" option in the OCE. I sort of understand this option's purpose, but I don't completely understand the SQL I'm seeing

  • CWS request removal from block list

    I had a client who is using CWS report that one of my domains is being blocked due to its inclusion in a malware database in CWS. Does anyone know of any way to request removal of a domain from the CWS block list? I called TAC and they stated that th

  • ABORT_MESSAGE_STATE    : message type 'A'

    How do you manage or handling the Abort message  in ITSmobile,? the message type 'A' produce a (ABORT_MESSAGE_STATE : HTTP 500 - Internal Server Error)   MSGTY = 'A' . For a easy example do you create  a simple ITSmobile  application ; send a message

  • Why did my Mac just sleep while transcoding?

    I'm siting at my desk and my computer sleep'd like it always does, but this time fcpx was right in the middle of proxy encoding! Why does that happen?