Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

commandLink in table -> javax.servlet.ServletException: Can't find bundle

 
Ranch Hand
Posts: 153
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo
I am using JBoss 6 (Mojarra 2.0)

When I press the commandButton I get

The problem is the

When I remove it the application works.

I have no idea what this means or how I can solve the problems.

Many thanks for any input.

Hans
 
Saloon Keeper
Posts: 28654
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Time to be pedantic again:

Backing beans are not Controllers. They are Models.

I'll be glad to discuss nuances, but I've seen what kind of horrors people code when they don't observe the distinction. Hence, the not-so-subtle hint.

Bundles are typically attached to JSF webapps in faces-config.xml file. A Bundle is a classpath object, so the rules on naming and locating bundles are the same as for classes.

That would commonly mean a file in the WEB-INF/classes/resources/application directory. Or, actually, I suspect that it's looking for a bundle named "application" in the WEB-INF/classes/resources directory. Since the point of bundles is to support I18N, the actual bundle name needs to be something like "application.en" for standard English.
 
Markus Schmider
Ranch Hand
Posts: 153
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After some research I have added
el-api-1.1.jar
el-impl-1.1.jar
to the lib directory of JBoss
and

to web.xml
Now at least I get an error message which makes more sense:


Still...
I am trying to emulate an article from a Java magazine which shows that it should be possible to use the variable declared in <h:dataTable var="...">
in method expressions.
 
Markus Schmider
Ranch Hand
Posts: 153
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
to Tim.
Thanks for your kind reply.

I have separated controller from model Logic: The Controller has a reference to the model.
If you know a more elegant way I would be very interested to learn it.

By the way my problem is about Method Expression Parameters. Perhaps should have expressed myself more clearly.

Thanks,

Hans
 
Tim Holloway
Saloon Keeper
Posts: 28654
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSF apps have little or no user-written Controller code in them. Mostly it uses canned Controller components (the FacesServlet and JSF Tag processors) which are wired up in the Views to their corresponding Models.

Action processors are not Controllers. They're the entry into the business methods that are fired when a command Controller such as a commandButton or commandLink is activated. Or lately, by AJAX, but the same mechanism applies. "Pure" MVC doesn't actually address what to do with data, just how to keep a model and its view in sync via Controllers. In the real world, of course, we do have to jump off into practical applications (business logic), and that's what the Action methods for.

Ideally, one would keep the Actions separate from the Backing properties, but in actual practice, it's usually more trouble than it's worth.

It is not a good idea to attempt to invoke Action methods as though they were general-purpose functions. Although JSF2 makes parameterizing things easier, the original concept was for Action methods to accept no parameters and return a navigation indicator (String). Parameters are neither required nor desirable, because the action processor should be accessing data directly from the Model, not from the View. Putting stuff like that in the View clutters up the View definition, ties it more tightly to a specific usage, adds network overhead, and on top of all that, is a potential security hazard.

Just to make things even more problematic, the EL language used on View definitions is NOT java, any more than JavaScript is. EL has its own syntax, restrictions and modes of operation. When it comes to EL, simpler is better.
 
reply
    Bookmark Topic Watch Topic
  • New Topic