The Artima Developer Community
Sponsored Link

Java Answers Forum
java beans

1 reply on 1 page. Most recent reply: May 12, 2004 4:22 AM by Antony

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Sailaja

Posts: 2
Nickname: sonu193
Registered: Apr, 2004

java beans Posted: Apr 29, 2004 1:10 PM
Reply to this message Reply
Advertisement
hi all please help me with this question...

<%@ page language="java" import="com.mypackage.MyBean" %>
<jsp:useBean id="myBean" class="MyBean"/>
<jsp:setProperty name="myBean" property="myProperty" value="<%=request.getParameter("sentProperty")%>"/>
<jsp:getPropert y name="myBean" property="myProperty"/>
MyBean.java

Package com.mypackage;

Public class MyBean
{
private String myProperty;

public MyBean()
{
this("initialValue");
}

public MyBean(String myProperty)
{
this.myProperty= myProperty;}

public void setMyProperty(String myProperty)
{
this. MyProperty= myProperty;
}

public String getMyProperty()
{
return myProperty;
}
}

Which of the following is the result produced when MyUseBean.jsp is accessed with the URL
MyUseBean.jsp?sentProperty=
(With out any value provided to sentProperty)
Select 1 correct Choice.

A.
Runtime Error

B.
Prints "null"

C.
Prints "initialValue"

D.
None Of the Above


Thanking u in advance
Sailaja


Antony

Posts: 2
Nickname: antonyms
Registered: May, 2004

Re: java beans Posted: May 12, 2004 4:22 AM
Reply to this message Reply
A. Runtime Error

Flat View: This topic has 1 reply on 1 page
Topic: Email,Applets and Result Previous Topic   Next Topic Topic: applet help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use