Solved

JSP forward and Bean Execution question

Posted on 2004-03-25
3
184 Views
Last Modified: 2010-04-01
hey guys
general question
this is a similar question
that i had help from kennethxu with
earlier
is there any way in JSP that you can forward from one page to another
after a process/method is complete in the associated javabean without the method being a boolean

i have an insertData() method in the bean of type void
it is processed when isValid() boolean method is true
after the insert is complete i would like to move to another page
<% if(Bean1.isValid())
               Bean1.insertData(); %>

after the insert is complete i would like to move on to the new page
i tried this but it don't work

<% if(Bean1.isValid())
               Bean1.insertData(); {%>
<jsp:forward page="main.jsp"/>
<% } %>

would i have to do a redirect in the bean instead??
gaz
0
Comment
Question by:Gar04
  • 2
3 Comments
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10681146
what problems you got in the above written code????
0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 500 total points
ID: 10681179
and if I think your if condition is written incorrectly up there...

it should be

<% if(Bean1.isValid())
 { Bean1.insertData();%>
<jsp:forward page="main.jsp"/>
<% } %>

if you want to keep the jsp forward logic in side the if condition
0
 

Author Comment

by:Gar04
ID: 10682544
i have been staring at this stuff for too long

thanks a lot
gaz
p.s. i am a novice forgive me
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Starting your own business is always a daunting process, and for most people it is brand new experience. Avoid the common pitfalls by following these tips to start on the road to success.
The advancement in technology has been a great source of betterment and empowerment for the human race, Nevertheless, this is not to say that technology doesn’t have any problems. We are bombarded with constant distractions, whether as an overload o…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question