saravanaprabu baskaran

Greenhorn
+ Follow
since Jun 13, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by saravanaprabu baskaran

I cleared SCWCD 1.4 with 98% day before yesterday.

My score in final mock exam is 73%. for me final mock exam score + 25 rule apply.

Real exam is much easier than the final mock exam of HFSJ.

I had a question from dynamic attributes. That was a direct question and Bryan's tutorial was more than enough to answer that question.

The following are my preparation materials.

1. HFSJ book. I read it twice.

2.Bryan's dynamic attribute tutorial(Which is not covered in HFSJ book).

https://coderanch.com/t/170429/java-Web-Component-SCWCD/certification/Tutorial-Dynamic-Attributes

3. Peabody's notes on Patterns.(Very good in exam point of view)
http://faq.javaranch.com/java/PeabodyOnScwcdPatterns

4. Gone through the Deshmuk's(manning Exam study Kit) chapter end questions and 'Exam quick preparation' at the end of the book. I read the chapters in which i scored less.

5.JavaRanch Mock Exam (1.4)
http://www.javaranch.com/carl/scwcd/scwcd_mock_logo.jsp

I thank each and every ranchers helped me to achieve this.

Thanks bert, bryan and kathy for the great book.
[ March 30, 2008: Message edited by: saravanaprabu baskaran ]
Hi,

Try the following code:

Page.jsp
--------
<html:form action="joblogs">
......
<a href="joblogs.do?dispatch=calculateResult"><img name="result"></a>
<a href="joblogs.do?dispatch=calculateTotal"><img name="total"></a>
</html:form>

struts-config.xml
------------------
<action path="/joblogs"
type="com.myapp.struts.JoblogsAction"
scope="request"
validate="true"
name="JoblogsActionForm"
parameter="dispatch" >

<forward path="/results.jsp" name="success"/>
<forward path="/totals.jsp" name="total"/>
</action>

JoblogsAction.java
--------------------
public class JoblogsAction extends DispatchAction {

private final static String SUCCESS = "success";
private final static String TOTAL = "total";

public ActionForward calculateResult(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
{
----- your action code here---
return (mapping.findForward(SUCCESS));
}
public ActionForward calculateTotal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
{
----- your action code here---
return (mapping.findForward(TOTAL));
}
}
18 years ago
Hi,

Ya its struts nothing to do with javascript.
18 years ago
Hi,

You can change the header details of the request before it reaches the action class.

You write one class which extends RequestProcessor, the looks like below one

//First check if the connection is secure.
try{
if (request.getHeader("HTTP")==null || !request.getHeader("HTTP").equals("on")){
response.sendRedirect("HTTP"+request.getRequestURI()+"?"+request.getQueryString());
return false;
}
}
catch(Throwable t){
log("There is a Exception in the request Processor while redirecting the request",t );
return false;
}
//
return true;
}


The RequestProcessor class will be excecuted before calling the action class and change the header from HTTPS to HTTP.

I have not tested the code. But, have a try and also look for other replies.
18 years ago
Hi,

You can have one action class for both the buttons But, your action class should extend DispatchAction.

The action class will have one dedicated method for each button.

On clicking the button corresponding method of the action class will be called based on the parameter you pass(Parameter will have the exact method name, you will specify it in struts config file)
18 years ago
Hi,

Kindly go through the below link for example struts application
18 years ago