Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

Problem with jsp:getproperty

Thread view: 
Meendar - 07 Jun 2007 12:56 GMT
I am having an textbox inside a form , form is used for entry and
edit .
I have used an useBean to display the values while edit.
while i go for edit i have to write java code as

if(bean1.getMethod()!=null)
{
<jsp:getproperty name="bean1"  property="method" />
}

Is there any possiblity to avoid code inside the jsp.

Thanks in Advance!
Lew - 07 Jun 2007 13:52 GMT
> I am having an textbox inside a form , form is used for entry and
> edit .
[quoted text clipped - 7 lines]
>
> Is there any possiblity to avoid code inside the jsp.

If you're using modern JEE with JSTL and EL:

<c:if test="${! empty bean1.method}" >
 <jsp:getproperty name="bean1"  property="method" />
</c:if>

or better yet, using whatever larger expression you're failing to show us:

<input type="text" id="method" name="method" value="${bean1.method}" />

without any conditional.  In unified EL with JSF, it'd be better to use:

<h:inputText id="method" value="#{bean1.method}" />

without any conditional.

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.