@Controller
@Named
@SessionScoped
@Path("/connection")
public class ConnectionController implements Serializable {
private static final long serialVersionUID = 1L;
String url;
public ConnectionController() {
super();
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
....
}--
You received this message because you are subscribed to the Google Groups "MVC 1.0 Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsr371-users...@googlegroups.com.
To post to this group, send email to jsr371...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsr371-users/588fe997-4b33-4347-ba70-d83bada70371%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I have a question about controllers and javax.enterprise.context.SessionScoped
This controller seems to work fine with Wildfly (RestEasy). It is instantiated once in a session. But running the same code in Payara/Glassfish (Jersey) the controller is created in each request - so it seems my annotation @SessionScoped is ignored?Is this normal, is this expected or am I doing something totally stupid here?
My application runs with javax.mvc-api 1.0-pr and ozark-resteasy 1.0.0-m03....OK ...and now as I am writing this lines, it seems to be stupid... I think I have to use a ozark-jersey module here instead of ozark-resteasy?
But so I came to another question: In a situation, where I am building a general application to be deployed on wildfly or payara, do I need to create separate builds? Is this the correct way? I think I can do this with maven profiles....
And finally: I am absolutely fascinated how easy it is to build applications with MCV 1.0. I come from the JSF world and stared migrating form JSF to MVC. Once again: many thanks for this great framework!!
--
You received this message because you are subscribed to the Google Groups "MVC 1.0 Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsr371-users...@googlegroups.com.
To post to this group, send email to jsr371...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsr371-users/CAEXeC6zhj6b8Qe7AK35eXWB1rGV4vc6sDjbp57hYoo9ennqApA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsr371-users/CAG1%3DaA-ojoiFV7hozUZ93G-gTXBMjFdnxEdOv9eHPMPALNDZ3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsr371-users/CAEXeC6wAH8qwweUpTVO%2Be2cPCk4-8gazmMkD9urTFTaO%2BJLr3A%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "MVC 1.0 Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsr371-users...@googlegroups.com.
To post to this group, send email to jsr371...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsr371-users/CAG1%3DaA--yQGdgOTG_hzfG8M9-%3DEPqGZe6DWqbKhWJPx-aJ%3DOqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsr371-users/CAEXeC6wHnoWoYam3jLyZ5_E%2B4mUuajv0znEbxTbP8Z3RadGY5w%40mail.gmail.com.
Thanks for that clarification. I now change my controllers/model beans in my application and removed the @named annotation form the mvc controllers as you suggested. I am working with injected CDI models and everything works perfect.
Why I was so confused: The problem comes from Wildfly. Wildfly and it's CDI implementation is very tolerant concerning scopes. You can nearly mixing all things together - servlets, Beans, EJBs, cdi-events... . Wildfly will always handle this. In contrast Glassfish is more strict in handling CDI and this can lead in a situation where an application, developed in Wildfly will break in Glassfish. This is a little bit frustrating. Because glassfish and payara are the main implementations of Java EE and in case of CDI and Jax-RS there is a lot of different behavior.
For example in Wildfly the following code snipped is fine:// javax.ws.rs.client.Clientclient.target(uri).request().put(null);in Payara this code dose not work because the implementation complains about the missing Entity object.
For most projects this is no problem at all because they are developed against only one specific platform. But if you try to implement a general framework (like your Imixs-Workflow project) it is hard work to avoid the usage of proprietary code and ensure that the code is interpreted in the same way on both platforms.
But this is now a little bit off topic. So concerning my question everything is fine now. In MVC it is important to understand the Model concept as you explained again.Would it make sense to print a warning in case an MVC controller is annotated with @named?