Solved

JSP forward and Bean Execution question

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
change size of out.write buffer 1 87
Jquery ajax file upload not working 11 154
nested if has else if 13 92
TreeSet comparator example 7 90
In the hope of saving someone else's sanity... About a year ago we bought a Cisco 1921 router with two ADSL/VDSL EHWIC cards to load balance local network traffic over the two broadband lines we have, but we couldn't get the routing to work consi…
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now