poornima balagopal

Ranch Hand
+ Follow
since Dec 02, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by poornima balagopal

Hi,
I have configured session timeout for my pages.

Now in one of the pages, i have a submit action. My session is timeout when i click on the link. If i relogin again, since it was the submit what i clicked before the session timeout, it directly submit my page.

How can i prevent the page from being submitted when the user logging in again after a time out?


Any kind of help will be greatly appreciated.

Regards,
Poornima
9 years ago
JSP
Hi,
I have a jsp on which I have two text boxes(txtfield1,txtfield2) along with an Add Button. When I click on Add button, I need to add a new section in the same page as that with the same fields. It is possible through jquery/java script with normal HTML code but I need to do this to generate struts tag fields.

It will be greatly greatly appreciated if anyone can tell me how can i do this( i have the javascript code to generate the html code but its not working for struts tags)+ I want to know how do I map this in my formbean.

Regards,
Poornima
11 years ago
Hi,
If you see your action mapping in the struts config file, you have mapped SignupAction1 class as the action class and contactFormBean as your formbean class for which the forward page is missing-value.jsp. But if you see in missing-value.jsp you have used 'messageBean' as your formbean class for your <bean:write> tag to display the value. When you give the name property as 'messageBean' in this tag it will look for this formbean class mapped for this particular action in struts config file.In your case it is contactFormBean not MessageFormBean.(you can go through the tag library user guide for more clarification) so it will show the error as 'Cannot find bean "messageBean" in any scope '.
When struts gives ActionForm classes to serve this requirment, i think there is no need to use a plain class like your messageFormBean and then set it into the request.
You can solve your problem by combining your contactFormBean class and MessageFormBean class into one you want to use only one FormBean class for the both. In your action class you just need to set the value for MessageFormBean.
14 years ago
Programming jakarta struts by Oreilly is really good and very well organized
14 years ago
Which version of struts you are using? check out the following code. Hope this may help you.
catch(Exception e) {
ActionMessages actionMessages = new ActionMessages();
actionMessages.add("Customers.update", new ActionMessage("errors.update", e.getClass().getName()
+ ": " + e.getMessage()));

saveErrors(request, actionMessages);

return mapping.findForward("failure");
}
14 years ago
Hi
Can you just try by adding the following tag in your jsp page?

<html:errors/>
This tag is used to access and present the results of Struts' data validation. Errors detected by other portions of the framework are accessible to the View component via this tag.

Mean while you can go through this link also.
http://forum.java.sun.com/thread.jspa?threadID=476429&messageID=2212084
14 years ago
Hi
When you submit your first page, you can set the value you want in the 3rd page to the form if you are using the same form for the 3rd page. If your form is in request scope, when you come from second page , make sure that its available to pass to 3rd page.For this when you submit your 2nd page, you need to check whether the value is available or not , if yes, set back to the form.
This is my idea.
14 years ago
Hi
In my struts-config.xml mapping for the tiles will be as follows
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/config/tiles/tiles-defs.xml"/>
<set-property
property="moduleAware"
value="true" />
</plug-in>

Now in the tiles-def.xml file
define the definition as follows
<definition name="/template.tile" page="/pages/layout/basic_template.jsp">
<put name="header" value="/pages/includes/header.jsp" />
<put name="menu" value="/pages/includes/menu.jsp" />
<put name="content" value="/pages/replaceme.jsp" />
<put name="footer" value="/pages/include/footer.jsp" />
</definition>

now in my struts class i have an action mapping in which i have a forward as follows
<action
path="/logon"
type="org.actions.LogonAction"
name="logonForm"
input="/pages/standard/logon.jsp"
scope="request">
<forward name="success" path="/homepage.tile" />
<forward name="failure" path="/pages/standard/logon.jsp" redirect="true"/>
</action>

The path given in the forward /homepage.tile is mapped to the tiles definition i have created in my tiles-def.xml as follows
<definition name="/homepage.tile" extends="/template.tile">
<put name="content" value="/pages/standard/home.jsp" />
</definition>

Hope this sample will help you

regards
Poornima
14 years ago
Hi
there is no problem in using validator. Most of the general validations we need to performs for the fields in the form, have been covered by validation.You just need to associate your fields with the required validations in your application level validation.xml file.


regards
Poornima
14 years ago
Hi
I was using Eclispe and jdeveloper.both are good for struts development. For eclipse you need a plugin thats it.
14 years ago
Hi shailesh
i think you need to give the relative path while specifying the page which you want to open on click on the link
like as follows
<html:link page="/openthispage.html">page</html:link>
I have placed this page directly under my webapplication folder.
Hope this will help you

regards
Poornima
14 years ago
Hi
Since your fields are not there inside the <html:form> i dont think you will be able to get those in the respective action class using ActionForm.
If you want to get these values without keeping these fields inside <html:form> tag, have hidden fields for the same and get the values in the action class and set to the form object if there are properties to hold the values.
If you do this you can get these values in your next page using the form bean.
14 years ago
Hi
if you see the following link "http://struts.apache.org/struts-doc-1.2.7/api/org/apache/struts/action/Action.html" you can see that the way to add errors which has to be displayed on the page is through
.addErrors() method in the Action class.
Hope this will be helpful to you

regards
Poornima
14 years ago
hi
i am not sure about this approach. What i was doing in one of my project is i use a Helper class which in turn have the ejb lookup part and other implementation part. So only this class call used be there in my action class.
14 years ago