AW: AW: getting error-texts into global xml

"Bernhard Woehrlin" <[email protected]>
Newsgroups gmane.comp.java.strutscx.user
Organization IT.CappuccinoNet.com
Message-ID <000d01c3f6d0$d372c350$4b01a8c0@javaws>
Hi Stephan,

you could do this:

// get the resource properties file
Document varDoc =
  (Document) servlet.getServletContext().getAttribute(
  StrutsCXConstants.RESSOURCEPROPERTIES_FILES
  + "."
  + getLocale(request).getLanguage());
			
// wrap it in a JXPathContext
vars = JXPathContext.newContext(varDoc);
		
// access the error string
String error_on_date =
  (String) props.getValue("//errors/dateElement");

// if an error occurs add an error
errors.add("dateElement", new ActionError("someString")); 
request.addAttribute("error_on_date", error_on_date);

... 

Berny



-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von
Stephan Reichelt
Gesendet: Donnerstag, 19. Februar 2004 10:49
An: [email protected]
Betreff: Re: AW: [Strutscx-user] getting error-texts into global xml

Bernhard Woehrlin wrote:

HI,

> // if an error occurs add an error
> errors.add("dateElement", new ActionError("someString")); 
> request.addAttribute("error_on_date", " Please enter valid date!");

ok, this option is possible too, but not satisfying to me.

In my understanding, occuring errors due to input mistakes should not to

be set into the request/response/session section of the XML, shouldn't
they?

It would be nice to have these entries in the /root/errors path.

Alternative to errors.add, is the global XML available through

   session.getAttribute(StrutsCXConstants.XML_DEBUG_PARAM)???

MfG,
   Stephan R.
-- 
[email protected]
Fraunhofer IVI          Tel: +49 351 4640 616



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Strutscx-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strutscx-user



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.