Skip to main content

Import JSDK class in facelets page

4 replies [Last post]
steelyx2
Offline
Joined: 2010-01-15

What is solution in facelets page to JSP's

<%@ page import="java.util.*"%>

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jdlee
Offline
Joined: 2006-01-25

The short answer is to move that to a managed bean. The longer, more helpful answer depends on what you're trying to do. In a nutshell, though, you would probably create a method, getBar(), on your bean, Foo, which you would then reference in your page via #{foo.bar}. Does that help? :)

steelyx2
Offline
Joined: 2010-01-15

That solution ( move functionality to Manged Bean) is one solution that solves the problem.
Otherwise I would like to know how this could be done in page
for example to use MessageFormat.format ( ...) method to format for ex h:outputText data.

jdlee
Offline
Joined: 2006-01-25

It can't be done in the page. Facelets explicitly disallows Java code in your page.

Jim Driscoll

Because (it needs to be said) it leads to sloppy code that's usually
hard to maintain.

Jim

On 1/21/10 5:46 AM, webtier@javadesktop.org wrote:
> It can't be done in the page. Facelets explicitly disallows Java code in your page.
> [Message sent by forum member 'jdlee' (jasondlee@sun.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=382140
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net