Hi Merrill
I have been trying to resolve one issue but could not. I thought You might have an answer.Can you please help me on this.
Here is the issue.
In my struts application, I have a log in page that leads to homepage where I have all the opations like inser/delete... to manupulate database data. Home page is divided into 4 frames. Topframe for title, leftframe for list of operations and on right frame again divided into top and bottom frames. SO, when user clicks on delete he has to select some values that are displayed on right topframe and then click submit button. So in the corresponding action class first I will check whether the user is valid to perform this action if not it has to go back to login page. If the user is a valid user then correctsponding page will display on bottom right frame other wise whole page has to redirect to login page. That is where I am facing the issue. "In either case the resultent page is getting displayed in the bottom right frame itself". I specified redirect="true" for "login" forward which is a global-forward like below..
Struts_config
-----------------
<global-forwards>
<forward name="login" path="/logon.jsp" redirect="true"/>
</global-forwards>
<action path="/insertData" name="insertDataForm" scope="request" type="com.boeing.aiCredentialValidator.actions.InsertAction" input="/insert.jsp">
<set-property property="loginRequired" value="true"/>
<forward name="success" path="/insertSuccess.jsp"/>
<forward name="failure" path="/blank.htm"/>
In my top right frame jsp page I have below code:
-----------------------------------------------------
function OnSubmitForm()
{
if(queryString('operation') == "view")
{
document.myForm.action ="viewinterfacecredentials.do";
document.myForm.target="lowerFrame";
document.myForm.submit();
}
else if(queryString('operation') == "delete")
{
document.myForm.action ="deleteConfig.do";
document.myForm.target="lowerFrame";
document.myForm.submit();
}
else
{
document.myForm.action ="updateInsertIC.do";
document.myForm.target="lowerFrame";
document.myForm.submit();
}
}
In my action class I have below code:
-------------------------------------
public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
StringBuffer operationType=new StringBuffer();
HttpSession session = request.getSession();
String target = new String("success");
EmployeesActionMapping employeesMapping = (EmployeesActionMapping)mapping;
if(employeesMapping.isLoginRequired())
{
if(session.getAttribute("USER") == null)
{
target = new String("login");
ActionErrors errors = new ActionErrors();
errors.add("org.apache.struts.action.GLOBAL_ERROR", new ActionError("errors.login.required"));
if(!errors.isEmpty())
{
saveErrors(request, errors);
}
return mapping.findForward(target);
}
}
.........
...............
}
Regards
Radha
[ July 07, 2008: Message edited by: radha kethana ]