aspose file tools*
The moose likes JSP and the fly likes Is there a way to use in JSTL format tags?" title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Is there a way to use "prefix" with <fmt:setBundle> in JSTL format tags?" Watch "Is there a way to use "prefix" with <fmt:setBundle> in JSTL format tags?" New topic
Author

Is there a way to use "prefix" with <fmt:setBundle> in JSTL format tags?

Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
I'm reading up on the format tags of JSTL (1.2). I see that I can include a prefix tag with a <fmt:bundle> tag, such as:However, to use this, I would need to wrap all the JSP code inside the <fmt:bundle> tag.
On the other hand, I can use a <fmt:setBundle> tag at the top of the JSP page (and set the scope to, say session) and my JSP page will use this as the resource bundle. Using this, it seems I can't set a prefix, so I will have to specify my message tag as:Is there a way I can specify a message bundle to be used by the page and still be able to take advantage of the prefix tag without having to wrap my entire JSP page in the bundle tag?

By the way, do I understand correctly that without the prefix tag, my message key must include the fully-qualified package name of the resource file, as in com.package.Messages.messagekey, even when the bundle/setbundle tags include the fully-qualified resource name already? This seems redundant.

Thanks,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a way to use "prefix" with <fmt:setBundle> in JSTL format tags?