[prev in list] [next in list] [prev in thread] [next in thread] 

List:       velocity-dev
Subject:    [jira] Commented: (VELTOOLS-105) MessageTool doesn't support
From:       "Nathan Bubna (JIRA)" <dev () velocity ! apache ! org>
Date:       2008-05-28 20:37:45
Message-ID: 379987206.1212007065126.JavaMail.jira () brutus
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/VELTOOLS-105?page=com.atlassian.jira.plugi \
n.system.issuetabpanels:comment-tabpanel&focusedCommentId=12600596#action_12600596 ] 

Nathan Bubna commented on VELTOOLS-105:
---------------------------------------

Colt, just to clarify, what version of VelocityTools is your patch for?  I'm pretty \
sure it's for 1.4, but it helps avoid confusion if you're specific. :)

I think this may be fixed in Tools 2.  As Christopher points out, in 2.0, if bundle \
and resources are both null then StrutsUtils.getMessageResources(req, app) is tried \
before just logging an error and returning null (as happens in 1.4).

I think for 1.4, the patch makes sense, even if it's not the ideal solution.   I'm \
not sure we'll be releasing a 1.5 version, but we may as well apply it to the 1.x \
branch just in case we do.

In the meantime, do you think you could try this with 2.0, Colt?  I'm curious to know \
if that version works for you.

> MessageTool doesn't support MessageResources the same way Struts does in terms of \
>                 scoping
> -----------------------------------------------------------------------------------------
>  
> Key: VELTOOLS-105
> URL: https://issues.apache.org/jira/browse/VELTOOLS-105
> Project: Velocity Tools
> Issue Type: Bug
> Components: VelocityStruts
> Affects Versions: 1.4, 2.0
> Reporter: Cott Lang
> Attachments: MessageResourcesTool.patch1
> 
> 
> We have an application that, for various reasons, inserts it's own MessageResources \
> object into the Request in the RequestProcessor. We do not have message-resource \
> defined in the struts config. This works fine in Struts, because Struts (at least \
> 1.2.9)  defaults 'bundle' to Globals.MESSAGES_KEY if it's null and checks the page, \
> request, and application scopes in that order (see TagUtils) StrutsUtils has \
> similar behavior.  Unfortunately, MessageResourcesTool prevents it from working \
> because getResources() returns an error if 'bundle' is null and there was not a \
> MessageResources in the ServletContext.  I fixed this by simply changing \
> MessageResourcesTool to return the locally cached 'resources' object if 'bundle' is \
> null and resources is not, but otherwise to call StrutsUtils and let it find the \
> MessageResources.  To be completely compatible with Struts, it seems like \
> StrutsUtils also needs to be modified to check the page scope before the request \
> scope. 2.0 is different, but looks like it would still suffer from this problem in \
> our application. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic