M Sharma

Ranch Hand
+ Follow
since Dec 13, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by M Sharma

Hi,

I haven't updated myself with the recent new developments on Java front post Java 1.4 edition. I would appreciate if anyone can suggest a book or a website which helps me bridge this gap which gives information on the new features being added post 1.4.


Thanks in Advance,

MS
Thanks all,

I worked out a solution using logic tags as shown below:



<logic:equal name="changePrice" property="dispatch" value="edit">
.................................................
.........here goes the code to be executed.......
.................................................
</logic:equal>
17 years ago
Thanks Dom,

That would have been a good idea, I would have tried that, but we are using tiles and have given tiles id for the input property in struts-config.xml


<action path="/changePriceAdj" type="com.sunmed.om.controller.ChangePriceAdjustmentAction" name="changePrice" scope="session" validate="true" input="tile.change_price_adjustment">
<forward name="refreshLineDetail" path="/addLineItemFromDetail.do?dispatch=editLineItem" />
<forward name="success" path="tile.order_entry_line_detail" />
<forward name="cancel" path="tile.order_entry_line_detail" />
<forward name="edit" path="tile.change_price_adjustment" />



below is the tiles snippet




TIA
17 years ago
Jim,

I already have one hidden variable with name "dispatch" in the JSP page.

The entire JSP page works on the basis of some condition. For example, if the value of "dispatch" is "view", we get a non editable page, and if the value of dispatch is "edit" it will show the page in edit mode etc.

Now when we submit the page, the dispatch value being passed is "save". The validations are being done in the validate method of the form. So if the validation fails, it returns the control back to the JSP. But this time the value which was last submitted for dispatch was "Save".

My goal is to interpret, at the TOP of the JSP page, whether there are any validation errors or not, which i have already done. And if there are errors, then i need to change the value of "dispatch" from "Save" to "Edit" at the TOP in the JSP file, so that rest of the code is executed as per "Edit" condition and the page gets displayed in the "Edit" mode.

This varaiable named "dispatch" is a ActionForm variable as well as it is present in the request scope. I found that, one which the JSP page interprets is a request scope variable. I think, we can no way change values of variables present in request scope at runtime, while the request is being interpreted.

I also tried accessing ActionForm variable in the JSP by refferring it as myForm.dispatch, but even that does not work . Here is one small code snippet....




I hope I answered your question. Trying to get rid of this problem, any help will be appreciated


TIA
17 years ago
Hi Merrill,

I totally agree with you, even my preference has always been JSTL tags. The reason for not using it is because, struts tags are used all over the project and not a single jsp page contains JSTL tags. Just an effort to make it consistent with the current code, so that it does not create any maintainence problems in the future, i thought of sticking to struts tags.


TIA
17 years ago
Kindly help, still haven't got any solution on this
17 years ago
Thanks Jim,

In my case, this solution won't work. I am checking the validationErrors property of form bean, and if that form is processed with error's, i need to overwrite one of the property of the form bean before processing the rest of the jsp.

I am not sure whether <bean : define> tag will be useful to me, i am currently evaluating this tag to see if it helps me to overwrite one of the form bean's property at runtime.


TIA
[ May 03, 2007: Message edited by: Manish Sachdev ]
17 years ago
Hi,


I am looking out for a <c:set> equivalent tag in struts tag library. If it is possible using struts tag, i would appreciate if an example of the usage is also provided.

The purpose is to overwrite a value of one of the attributes of the form bean. This could have been acheived using c:set, but since we are not using any standard tags, would like to achieve the same using struts tag. So was looking out for a alternative of c:set in struts ...


TIA
[ May 03, 2007: Message edited by: Manish Sachdev ]
17 years ago
Bert,

Your books seem to be in demand right from their inception stages.

There are high chances of your spring book outnumbering sales figures of your existing books

So wish to see your book on spring in near future.


TIA
17 years ago
Hi Bert,

Are you planning to write any books on Spring Framework ? Would love to learn Spring using your Head First series.

So any plans for Spring ?


TIA
17 years ago
Even I am awaiting latest book on Spring, which covers Spring 2.0. Micheal, kindly let me know in case if you have got any information


TIA
I'm quite impressed by the review. Does it cover Spring 2.0 ? I am looking out for latest book which covers Spring 2.0, and would me more than happy to buy Pro Spring.

I'm located in India, So I hope, authors must be having tie-ups with indian publishers for publishing of this book

I would like to know whether there are any other books which cover Spring 2.0, available in market ?


TIA
17 years ago
I want to package an web application by keeping resource bundle files outside war so that the user can change it easily without tampering war file.

I am using Eclipse IDE and Tomcat 5.x.

Whenever I try to keep the resource bundle outside the application, by setting it in system classpath, I am not able to refer it in the programs.

Kindly help me in this regard.

TIA
[ January 16, 2007: Message edited by: Manish Sachdev ]
17 years ago
Hi Javardhan,

I faced similar problem and got a solution to it.

You can view the solution at
https://coderanch.com/t/55144/Struts/Custom-Validations-Struts-Validator-Framework
18 years ago
Thanks folks!!

At last i got the solution

It seems that later versions of struts, have started populating ActionMessages instead of ActionErrors in case of any validation being voilated. I just replaced the ActionErrors parameter in my validate method to ActionMessages and it worked

I have highlighted the changes in bold.

validation-rules.xml
=======================================




SalesRepExistanceValidator class (Changes done in signature only, ActionErrors replaced by ActionMessages)
=======================================================



I hope it helps others facing a similar problem
[ November 17, 2006: Message edited by: Manish Sachdev ]
18 years ago