[JBoss Portal] - Is header content injection coded in portal 2.4.0 ?
by mvera
Hi,
I use JBossPortal 2.4.0 and i'm still trying to insert code in html header via RenderResponse API like this :
RenderResponse rr = getRenderResponse();
|
| rr.addProperty("HEADER_CONTENT", _htmlBuff.toString());
But this doesn't work, I still have an empty head :
<head>
| <title>My Layout</title>
| <meta http-equiv="Content-Type" content="text/html;" />
| <link rel='stylesheet' type='text/css' id='main_css' href='/portal-core/themes/phalanx/portal_style.css' />
| <link rel='shortcut icon' href='/portal-core/themes/phalanx/images/favicon.ico' />
| </head>
I changed my layout (I hadn't understand this before) and I used the one provided inline in the reference guide :
<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <html xmlns="http://www.w3.org/1999/xhtml">
| <head>
| <title>My Layout</title>
| <meta http-equiv="Content-Type" content="text/html;" />
| <p:theme themeName='phalanx' />
| <p:headerContent />
| </head>
|
I used debugger in my code and in JBossPortal code. So I know that:
+ in my code the call to addProperty is executed and the value is not null
+ the layout used is the one I specified
+ the headerContent tag is executed
But I don't understand why my header is still empty.
So I downloaded JBossPortal src, looked at it and visited it with the debugger. It seemed to me that nothing is done to retreive the data set in response properties for the key "HEADER_CONTENT" and that only header content set by a declarative way is retreived.
I only found 2 ocurrences of HEADER_CONTENT in JBossPortal source :
res.setProperty("HEADER_CONTENT", "<script>function wsrp_rewrite_OnFocus(){alert('hello button');}</script>");
|
and
/**
| * Constant to set the content that should be injected into the HEAD tag of the pages markup.
| * <p>The content set in a portlet response property with this flag will be injected into the HEAD tag, if the portal
| * layout features the headercontent tag.</p>
| */
| public static final String HEADER_CONTENT = "HEADER_CONTENT";
|
I wonder if that functionnality is coded ? If I'm wrong, could anyone tell me in which class it is done so that I can use my debugger to find what is my problem.
Thanks,
Mickaël
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982981#3982981
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982981
19Â years, 6Â months
[JBoss Seam] - Re: Nested conversation question
by Ci
Sorry, it does not work either.
In Manager class there is an unlockConversation() method. After the nested conversation is destroyed, getCurrentConversationEntry() will return null, and its stack (which is obviously not empty) won't be unlocked.
I suppose something like that:
public void unlockConversation()
| {
| ConversationEntry ce = getCurrentConversationEntry();
| if (ce!=null)
| {
| ce.unlock();
| }
| else
| {
| // current can be destroyed, but its stack can be not even unlocked
| for ( String conversationId: currentConversationIdStack )
| {
| if (conversationId.equals(currentConversationId)) continue; // destroyed
| ConversationEntry cen =
| ConversationEntries.instance().getConversationEntry(conversationId);
| if (cen != null)
| {
| cen.unlock();
| break;
| }
| }
| }
| }
It works :) After you did the whole stack to share one lock instance, the problem is nearly solved.
Btw, thank you for Seam :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982979#3982979
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982979
19Â years, 6Â months
[Tomcat, HTTPD, Servlets & JSP] - SessionTimeout bug in tomcat 5.5.20
by sreeraaman
Hi,
I am working on container managed authentication using a form based login. I have configured web security as follows in web.xml:
| <error-page>
| <error-code>400</error-code>
| <error-code>403</error-code>
| <error-code>404</error-code>
| <error-code>500</error-code>
| <location>/index.jsp</location>
| </error-page>
| <security-constraint>
| <web-resource-collection>
| <web-resource-name>Whole site</web-resource-name>
| <url-pattern>/secure/*</url-pattern>
| </web-resource-collection>
| <auth-constraint>
| <role-name>*</role-name>
| </auth-constraint>
| <user-data-constraint>
| <transport-guarantee>NONE</transport-guarantee>
| </user-data-constraint>
| </security-constraint>
| <login-config>
| <auth-method>FORM</auth-method>
| <realm-name>SecDomain</realm-name>
| <form-login-config>
| <form-login-page>/Login.seam</form-login-page>
| <form-error-page>/authorization-error.seam</form-error-page>
| </form-login-config>
| </login-config>
|
I have a JSF page in the secured realm (/secure/) from where I am calling a EJB3 stateless session bean using JBoss Seam.
It is working fine if the session has not timed out. However, if the session has got timed out and after which if I try to call a method on a SLSB, I get the following error:
| HTTP Status 403 - The request body was too large to be cached during the authentication process
| ________________________________________
| type Status report
| message The request body was too large to be cached during the authentication process
| description Access to the specified resource (The request body was too large to be cached during the authentication process) has been forbidden.
| ________________________________________
| Apache Tomcat/5.5.20
|
Going through the server logs, I find the following output:
| 2006-11-03 19:26:33,787 DEBUG [org.apache.catalina.authenticator.FormAuthenticator] Save request in session '277A5C3578B0DDDF9DA12DEEA47985AB'
| 2006-11-03 19:26:33,787 DEBUG [org.apache.catalina.authenticator.FormAuthenticator] Request body too big to save during authentication
| 2006-11-03 19:26:33,787 DEBUG [org.apache.catalina.authenticator.AuthenticatorBase] Failed authenticate() test
|
Going through the source for the FormAuthenticator Class, I found that the above message was displayed in the authenticate method, the snapshot of which is as follows:
| // No -- Save this request and redirect to the form login page
| if (!loginAction) {
| session = request.getSessionInternal(true);
| if (log.isDebugEnabled())
| log.debug("Save request in session '" + session.getIdInternal() + "'");
| try {
| saveRequest(request, session);
| } catch (IOException ioe) {
| log.debug("Request body too big to save during authentication");
| response.sendError(HttpServletResponse.SC_FORBIDDEN,
| sm.getString("authenticator.requestBodyTooBig"));
| return (false);
| }
| forwardToLoginPage(request, response, config);
| return (false);
| }
|
Also, I noticed that the saveRequest method does not throw any exception in the previous versions.
Inside the saveRequest method, the highlighted line in the following code snippet is the place where the exception is thrown:
| if ("POST".equalsIgnoreCase(request.getMethod())) {
| ByteChunk body = new ByteChunk();
| body.setLimit(request.getConnector().getMaxSavePostSize());
|
| byte[] buffer = new byte[4096];
| int bytesRead;
| InputStream is = request.getInputStream();
|
| while ( (bytesRead = is.read(buffer) ) >= 0) {
| body.append(buffer, 0, bytesRead);
| }
| saved.setBody(body);
| }
|
I understand that by default the getMaxSavePostSize() returns 2MB .
I would have expected Tomcat to have redirected me to the login page since, the session has expired.
Note:
I am using JBoss 4.0.5 GA, Seam 1.0.1 GA and Tomcat 5.5.20.
regards
sriraman.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982977#3982977
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982977
19Â years, 6Â months
[JBossCache] - Re: PojoCache 2.0 (replicate method execution)
by mleur
Hi,
Thanks for your response, I tries to create a new RpcTreeCache and call my method... but it doesn't work again with the same exception.
XmlConfigurationParser parser = new XmlConfigurationParser();
| Configuration conf = parser.parseFile( "cache-config.xml" );
| TimerSessionValidity timer = new TimerSessionValidity("maxime","id");
|
| RpcTreeCache rpcCache = new RpcTreeCache();
| rpcCache.setConfiguration(conf);
| rpcCache.start();
|
| Method method = timer.getClass().getMethod("pingSession2",new Class[]{String.class});
| rpcCache.registerRPCHandler("timer", timer);
| rpcCache.callRemoteMethods("timer",rpcCache.getMembers(), method,new Object[]{ "maxime"}, false, false, (long) 1000);
Could you give a simple code example of RPC calls ???
Because I am lost.
Many Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982974#3982974
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982974
19Â years, 6Â months