Solved

JSP forward and Bean Execution question

Posted on 2004-03-25
3
183 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Adding Computers to AD groups through an SCCM Task Sequence
This article outlines why you need to choose a backup solution that protects your entire environment – including your VMware ESXi and Microsoft Hyper-V virtualization hosts – not just your virtual machines.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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