[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4254) Postback is incorectly determined in integration tests for NonFacesRequest and JSF 1.2
by Michal Orman (JIRA)
Postback is incorectly determined in integration tests for NonFacesRequest and JSF 1.2
--------------------------------------------------------------------------------------
Key: JBSEAM-4254
URL: https://jira.jboss.org/jira/browse/JBSEAM-4254
Project: Seam
Issue Type: Bug
Affects Versions: 2.1.2.GA
Reporter: Michal Orman
If I create NonFacesRequest to view which invokes action (for loading data), and contain page parameters, postback is determined to true (where it should be false). It happens because MockResponseStateManager do not override ResponseStateManager#isPostback method which determines postback basing on request parameters. So no matter if it is FacesRequest or NonFacesRequest if view defines page parameters it will be evaluated as postback.
It works on production, because ResponseStateManagerImpl (from jsf-impl-1.2_12) overrides this method and determines if request is postback basing on ResponseStateManager.VIEW_STATE_PARAM parameter in requests parameters map.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3769) org.jboss.seam.ui.facelet.RendererRequest replaces HttpServletXXX with MockHttpServletXXX
by Kenneth Christensen (JIRA)
org.jboss.seam.ui.facelet.RendererRequest replaces HttpServletXXX with MockHttpServletXXX
-----------------------------------------------------------------------------------------
Key: JBSEAM-3769
URL: https://jira.jboss.org/jira/browse/JBSEAM-3769
Project: Seam
Issue Type: Bug
Components: JSF Integration
Affects Versions: 2.1.1.CR1
Environment: Mac OS X 10.5.5
JBoss AS 4.2.3.GA
JBoss Seam 2.1.1.CR1
Java 6
Reporter: Kenneth Christensen
Seam 2.0.3:
private void init()
{
// Make sure we are using the correct ClassLoader
originalClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
// If a FacesContext isn't available, set one up
if (FacesContext.getCurrentInstance() == null)
{
MockFacesContext mockFacesContext = new MockFacesContext(new MockExternalContext(new MockServletContext()))
.setCurrent();
mockFacesContext.createViewRoot();
}
FacesContext facesContext = FacesContext.getCurrentInstance();
// Wrap the ResponseWriter
originalResponseWriter = facesContext.getResponseWriter();
facesContext.setResponseWriter(facesContext.getRenderKit().createResponseWriter(writer,
null, null));
// Create a new UIViewRoot
originalViewRoot = facesContext.getViewRoot();
UIViewRoot viewRoot = new UIViewRoot();
viewRoot.setRenderKitId(facesContext.getApplication().getViewHandler().calculateRenderKitId(facesContext));
viewRoot.setViewId(viewId);
viewRoot.setLocale(originalViewRoot.getLocale());
facesContext.setViewRoot(viewRoot);
}
Seam 2.1.1.CR1:
private void init()
{
request = new MockHttpServletRequest(HttpSessionManager.instance());
response = new MockHttpServletResponse();
// Generate the FacesContext from the JSF FacesContextFactory
originalFacesContext = FacesContext.getCurrentInstance();
facesContext = RendererFacesContextFactory.instance().getFacesContext(request, response);
DelegatingFacesContext.setCurrentInstance(facesContext);
// Create the viewRoot
UIViewRoot newRoot = facesContext.getApplication().getViewHandler().createView(facesContext, viewId);
facesContext.setViewRoot(newRoot);
// Set the responseWriter to write to a buffer
writer = new StringWriter();
facesContext.setResponseWriter(facesContext.getRenderKit().createResponseWriter(writer,
null, null));
}
As you can see, Seam 2.1.1.CR1 never checks for the original FacesContext, but creates a new FacesContext which includes the MockHttpServletXXX.
It's a problem for the application I'm developing, because I need the external context (HttpServletResponse) when I'm using the renderer.render("/abc/xyz.xhtml").
It works fine with Seam 2.0.3, but not with Seam 2.1.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2419) IAE: factory method with defined scope outjected a value: guestRole
by Christian Bauer (JIRA)
IAE: factory method with defined scope outjected a value: guestRole
-------------------------------------------------------------------
Key: JBSEAM-2419
URL: http://jira.jboss.com/jira/browse/JBSEAM-2419
Project: JBoss Seam
Issue Type: Bug
Components: Core
Reporter: Christian Bauer
Priority: Minor
I can see this on the log on seamframework.org but can't reproduce it:
java.lang.IllegalArgumentException: factory method with defined scope outjected a value: guestRole
at org.jboss.seam.Component.handleFactoryMethodResult(Component.java:1953)
at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1927)
at org.jboss.seam.Component.getInstance(Component.java:1863)
at org.jboss.seam.Component.getInstance(Component.java:1840)
at org.jboss.seam.Component.getInstance(Component.java:1834)
at org.jboss.seam.wiki.core.action.Authenticator.getGuestAccessLevel(Authenticator.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
at org.jboss.seam.wiki.core.action.Authenticator_$$_javassist_9.getGuestAccessLevel(Authenticator_$$_javassist_9.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1926)
at org.jboss.seam.Component.getInstance(Component.java:1863)
at org.jboss.seam.Component.getInstance(Component.java:1840)
at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:111)
at org.jboss.seam.persistence.HibernatePersistenceProvider.enableFilter(HibernatePersistenceProvider.java:205)
at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:88)
at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:108)
This is thrown from the FeedServlet.
The code doesn't do what the exception says it is doing:
/**
* Assigns the context variable 'currentAccessLevel' when no user is logged in.
* @return Integer Guest access level.
*/
@Factory(value = "currentAccessLevel", scope = ScopeType.SESSION, autoCreate = true)
public Integer getGuestAccessLevel() {
return ((Role)Component.getInstance("guestRole")).getAccessLevel();
}
This has to be investigated further.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4273) edit.xhtml.ftl template cause duplicate id changeParent and selectParent
by Julien Kronegg (JIRA)
edit.xhtml.ftl template cause duplicate id changeParent and selectParent
------------------------------------------------------------------------
Key: JBSEAM-4273
URL: https://jira.jboss.org/jira/browse/JBSEAM-4273
Project: Seam
Issue Type: Bug
Components: Tools
Affects Versions: 2.1.2.GA
Environment: SEAM_HOME/seam-gen/view/edit.xhtml.ftl
Reporter: Julien Kronegg
When a MyEntityEdit.xhtml page with more than one foreign key is generated, the "Select" / "Change" button is generated with an id "changeParent" or "selectParent" for each foreign key.
This causes "duplicate id" errors when displaying the page.
The button id must be changed to be unique, e.g. by suffixing with the property name.
The line 136:
<s:button id="${'#'}{${homeName}.instance.${property.name} != null ? 'changeParent' : 'selectParent'}" value="${'#'}{${homeName}.instance.${property.name} != null ? 'Change' : 'Select'} ${property.name}"
must be replaced by:
<s:button id="${'#'}{${homeName}.instance.${property.name} != null ? 'changeParent${property.name?cap_first} ' : 'selectParent${property.name?cap_first}'}" value="${'#'}{${homeName}.instance.${property.name} != null ? 'Change' : 'Select'} ${property.name}"
I did not find references to the button id elsewhere, so it seems that no side effect will appear.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months