Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 9th, 2006, 08:46 PM
Registered User
Join Date: Oct 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default error messages

I want to know how I can display error messages that I will be getting from a different module and will not be available at message resources file.Basically I want to know how to display error messages without using the resources file.

Reply With Quote
  #2 (permalink)  
Old November 13th, 2006, 07:05 AM
Authorized User
Join Date: Aug 2006
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sachin.tathod

Create Valiation method in the form class and access it from action class.

Plz refer following sample code and u dont need to use sttuts validation.

private ActionErrors BusinessValidation(ActionMapping mapping, HttpServletRequest req) {

        ActionErrors errors = new ActionErrors();
        String method = req.getParameter("method");
            return errors;
        errors = super.validate(mapping,req);
        if(errors.size() > 0)
            return errors;
        String name = groupTypeVOType.getName().trim();
        int nameLength = name.length();
        if (PasskeyUtils.replaceAllSpecialChars(name).length( ) <nameLength) {
            errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("PPlDC_ValErrMsg_16"));

        if(groupTypeVOType.getCode().size() != 0) {
            CodeVOType TypeCodeVO = (CodeVOType)groupTypeVOType.getCode().get(0);
                    errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("PPlDC_ValErrMsg_25"));
            if (eCodeVO.getCode().length() > (Utils.replaceAllSpecialChars(
                    groupTypeCodeVO.getCode())).length()) {
                errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("PPlDC_ValErrMsg_17"));

        return errors;

Thanks and Regards,
Patni Computer System Ltd.
Magarpatta City, Cyber City,
Tower 3,Level I & II,
Hadapsar,Pune - 411028
Mobile No:- +91-9881239401
Email ID:- sachin.tathod@patni.com
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Customised Error Messages denzil_cactus Perl 3 June 15th, 2007 10:27 AM
Lua error messages trav BOOK Beginning Lua Programming ISBN: 978-0-470-06917-2 1 June 3rd, 2007 01:21 PM
error messages timbal25 Classic ASP Databases 0 August 1st, 2006 02:56 PM
Error messages ldoodle Access ASP 12 June 6th, 2005 01:05 PM

All times are GMT -4. The time now is 10:43 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.