Solved

JSP forward and Bean Execution question

Posted on 2004-03-25
3
180 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
Comment Utility
what problems you got in the above written code????
0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 500 total points
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to write service layer in Spring ? 4 273
form submissions on a web page 2 142
ajax auto save 15 93
bean mapper frameworks 5 56
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

12 Experts available now in Live!

Get 1:1 Help Now