Hi Sidney,
A couple of things to try:
- a1.jsp uses:
<jsp:useBean id="mybean" scope="session" class="com.vidbean"
type="com.vidbean"/>a2.jsp uses:
but a2.jsp uses:
<jsp:useBean id="mybean11" scope="request" class="com.vidbean" />
For both JSP files to share the bean, the should refer to the same bean
id (instead of "mybean" and "mybean11"). Also, the scope should be the
same.
- change your vidbean methods to setVid()/getVid() instead of
setvid()/getvid(). I believe the Beans spec is clear that for
a property named 'foo', the set/get methods should be setFoo()/getFoo().
regards,
-i
]Mime-Version: 1.0
]Content-Transfer-Encoding: 8bit
]X-MIME-Autoconverted: from quoted-printable to 8bit by mail.java.sun.com id
NAA18077
]Date: Mon, 27 Dec 1999 14:27:46 MST
]From: sidney woods <[EMAIL PROTECTED]>
]Subject: Passing parameters to bean
]To: [EMAIL PROTECTED]
]
]Hello,
]I am passing a string from a jsp file to a bean. in second jsp file i am
]trying to retrive the same parameter,but it is not working. i am working with
]jws on nt.
]here are the codes:
]1. bean
] package com;
] public class vidbean {
] public String vid;
]
] public vidbean() {
] vid = null;
] }
]
] public void setvid(String value ) {
]
] setvid((value==null) ? null : value);
] }
]
] public String getvid() {
] return vid;
] }
]}
]
]
]2. a1.jsp
]
]<jsp:useBean id="mybean" scope="session" class="com.vidbean"
]type="com.vidbean"/>
]<jsp:setProperty name="mybean" property="*" />
]
]
]<HTML>
]<HEAD>
]<TITLE>
]Calling Page
]</TITLE>
]</HEAD>
]
]<BODY><h1>Passing Parameters - Test </H1>
]
]<% String vm="XYZ"; %>
]<%
] out.println("Enter some Text");
]%>
]
]<form method="get" action="a2.jsp">
]<input type="text" name="vid" size="25">
]<br>
]<input type="submit" value="Submit">
]<input type="reset" value="Reset">
]
]</FORM>
]
]
]</BODY>
]</HTML>
]
]
]3. a2.jsp
]
]
]<HTML>
]<HEAD>
]<TITLE>
]Called Page
]</TITLE>
]</HEAD>
]
]<BODY BGCOLOR="#FFFFFF">
]<jsp:useBean id="mybean11" scope="request" class="com.vidbean" />
]<H1>Hello <jsp:getProperty name="mybean" property="vid" />!
]</H1>
]</BODY>
]</HTML>
]
]
]the beans .class file is correctly placed in classes folder of jws.
]any help would be great.
]thanks
]sidney
]
]
]____________________________________________________________________
]Get free email and a permanent address at http://www.netaddress.com/?N=1
]
]===========================================================================
]To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
]FAQs on JSP can be found at:
] http://java.sun.com/products/jsp/faq.html
] http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html