Reading Portlet Preferences in Weblogic Portal
| Posted by watashii | Filed under Programming, WebPortlet preferences enables portlets to be associated with external application data. This data should generally be used to store (or update) configuration data in a portlet. For example, to store/update dynamic stock codes in a stock quotes portlet. A portlet preference is basically a name-value pair data structure.
Portlet preferences can be added/updated in the following ways:
- During design-time on Workshop for Weblogic Portal (screenshot above)
- Invoked programmatically at request-time using javax.portlet.* API
- Manually during run-time of a portal (via Portal Administration Console when a portal desktop is created)
When we have added our preferences, we can read them using using the Weblogic Portal API’s. The following sample code fragments are for JSP Portlets, and JSF Portlets:
Tags: java, jsp, portal, portlets, preferences, weblogic
BusinessObjects Enterprise – Changing Tomcat Session Timeout
| Posted by watashii | Filed under BusinessObjects, Software, WebTo change the timeout limit of a BusinessObjects Enterprise XIR2 (Solaris) logged-in session (with Tomcat), the following files needs to be modified:
$BOBJE_HOME/tomcat/webapps/businessobjects/WEB-INF/web.xml
$BOBJE_HOME/tomcat/webapps/businessobjects/enterprise115/desktoplaunch/WEB-INF/web.xml
$BOBJE_HOME/tomcat/webapps/businessobjects/enterprise115/adminlaunch/WEB-INF/web.xml
$BOBJE_HOME/tomcat/webapps/businessobjects/enterprise115/adhoc/WEB-INF/web.xml
Find the following setting within the web.xml file to change the timeout value in minutes.
<!-- Define the default session timeout for your application,
in minutes. From a servlet or JSP page, you can modify
the timeout for a particular session dynamically by using
HttpSession.getMaxInactiveInterval(). -->
<session-config>
<session-timeout>20</session-timeout> <!-- 20 minutes for session objects -->
</session-config>
Then just restart the Apache Tomcat webserver to take effect.
Tags: BusinessObjects, jsp, timeoute, tomcat
How to Change Default Homepage in Tomcat
| Posted by watashii | Filed under Software, UnixWhen browsing to a Tomcat’s webserver, at the root URL over the default port 8080, it usually shows the default jsp homepage as pictured above.
http://localhost:8080
So how can I update / modify, or remove this page?
You might think changing the jsp page at [$CATALINA_HOME/webapps/ROOT/index.jsp] is all you need to do. This is where i found out its not the case! The page contents are compiled within the ROOT web application servlet. To make Tomcat reference the jsp page instead, we need to remove this servlet from being compiled.
Locate the ROOT web application’s config file at [$CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml], and simply comment out the following code fragment:
<!-- Comment this section so I can change the default index.jsp homepage
<servlet>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<servlet-class>org.apache.jsp.index_jsp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
-->
This will disable the index_jsp servlet. Now when you restart the Tomcat web application server, it should compile and load the default [$CATALINA_HOME/webapps/ROOT/index.jsp] page instead.

