BC4J / Struts application scope
i have one question:
how can I store objects in an application scope.
i'd like to store a collection with all users from a viewobject. this collection is used independent from usersessions or requests and can be created when application starts.
first i tried to achieve it by extending the struts actionServlet and storing it in the servletContext, but i was not able to create ViewObjects in the init-Method of the Servlet.
Thanks in advance
Martin
ServletContext would be the right place to store the information but you'll have to defer the population of your user list until the first session that tries to use it
Similar Messages
-
Need help with BC4J/Struts application using a Stored Procedure
Hi,
I am doing a proof of concept for a new project using JDeveloper, Struts and BC4J. We want to reuse our Business logic that is currently residing in Oracle Stored Procedures. I previously created a BC4J Entity Object based on a stored procedure Using Oracle Stored Procedures but this stored procedure is a bit different in that it returns a ref cursor as one of the paramters. http://radio.weblogs.com/0118231/stories/2003/03/03/gettingAViewObjectsResultRowsFromARefCursor.html
I tried the above method, but I am having some trouble with it. I keep getting the error ORA-01008: not all variables are bound when I test it using the AppModule tester.
Here is the store procedure definition:
CREATE OR REPLACE PACKAGE pprs_test_wrappers IS
TYPE sn_srch_results IS REF CURSOR;
PROCEDURE sn_srch_main_test
(serial_num_in IN OUT VARCHAR2
,serial_coll_cd_in IN OUT NUMBER
,max_rows_allowed IN OUT NUMBER
,total_rows_selected IN OUT NUMBER
,message_cd_out IN OUT VARCHAR2
,query_results OUT sn_srch_results
END pprs_test_wrappers;
And here is my code:
package pprs;
import java.math.BigDecimal;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import oracle.jbo.JboException;
import oracle.jbo.domain.Number;
import oracle.jbo.server.DBTransaction;
import oracle.jbo.server.ViewObjectImpl;
import oracle.jbo.server.ViewRowImpl;
import oracle.jbo.server.ViewRowSetImpl;
import oracle.jdbc.driver.OracleCallableStatement;
import oracle.jdbc.driver.OracleTypes;
// --- File generated by Oracle Business Components for Java.
public class LienCheckImpl extends ViewObjectImpl
* This is the PLSQL block that we will execute to retrieve the REF CURSOR
private static final String SQL =
"begin ? := pprs_test_wrappers.sn_srch_main_test(?, ?, ?, ?, ?, ?);end;";
public LienCheckImpl() {}
* Overridden framework method.
* Executed when the framework needs to issue the database query for
* the query collection based on this view object. One view object
* can produce many related result sets, each potentially the result
* of different bind variable values. If the rowset in query is involved
* in a framework-coordinated master/detail viewlink, then the params array
* will contain one or more framework-supplied bind parameters. If there
* are any user-supplied bind parameter values, they will PRECEED the
* framework-supplied bind variable values in the params array, and the
* number of user parameters will be indicated by the value of the
* numUserParams argument.
protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
* If there are where-clause params (for example due to a view link)
* they will be in the 'params' array.
* We assume that if some parameter is present, that it is a Deptno
* value to pass as an argument to the stored procedure.
* NOTE: Due to Bug#2828248 I have to cast to BigDecimal for now,
* ---- but this parameter value should be oracle.jbo.domain.Number type.
String serialNumIn = null;
BigDecimal serialCollCdIn = null;
BigDecimal maxRowsAllowed = null;
BigDecimal totalRowsSelected = null;
String messageCdOut = null;
if (params != null) {
serialNumIn = (String)params[0];
serialCollCdIn = (BigDecimal)params[1];
maxRowsAllowed = (BigDecimal)params[2];
totalRowsSelected = (BigDecimal)params[3];
messageCdOut = (String)params[4];
storeNewResultSet(qc,retrieveRefCursor(qc,serialNumIn,
serialCollCdIn,
maxRowsAllowed,
totalRowsSelected,
messageCdOut));
super.executeQueryForCollection(qc, params, numUserParams);
* Overridden framework method.
* Wipe out all traces of a built-in query for this VO
protected void create() {
getViewDef().setQuery(null);
getViewDef().setSelectClause(null);
setQuery(null);
* Overridden framework method.
* The role of this method is to "fetch", populate, and return a single row
* from the datasource by calling createNewRowForCollection() and populating
* its attributes using populateAttributeForRow().
protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
* We ignore the JDBC ResultSet passed by the framework (null anyway) and
* use the resultset that we've stored in the query-collection-private
* user data storage
rs = getResultSet(qc);
* Create a new row to populate
ViewRowImpl r = createNewRowForCollection(qc);
try {
* Populate new row by attribute slot number for current row in Result Set
populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
populateAttributeForRow(r,1, nullOrNewNumber(rs.getBigDecimal(2)));
populateAttributeForRow(r,2, rs.getString(3));
populateAttributeForRow(r,3, rs.getString(4));
populateAttributeForRow(r,4, rs.getString(5));
catch (SQLException s) {
throw new JboException(s);
return r;
* Overridden framework method.
* Return true if the datasource has at least one more record to fetch.
protected boolean hasNextForCollection(Object qc) {
ResultSet rs = getResultSet(qc);
boolean nextOne = false;
try {
nextOne = rs.next();
* When were at the end of the result set, mark the query collection
* as "FetchComplete".
if (!nextOne) {
setFetchCompleteForCollection(qc, true);
* Close the result set, we're done with it
rs.close();
catch (SQLException s) {
throw new JboException(s);
return nextOne;
* Overridden framework method.
* The framework gives us a chance to clean up any resources related
* to the datasource when a query collection is done being used.
protected void releaseUserDataForCollection(Object qc, Object rs) {
* Ignore the ResultSet passed in since we've created our own.
* Fetch the ResultSet from the User-Data context instead
ResultSet userDataRS = getResultSet(qc);
if (userDataRS != null) {
try {
userDataRS.close();
catch (SQLException s) {
/* Ignore */
super.releaseUserDataForCollection(qc, rs);
* Return a JDBC ResultSet representing the REF CURSOR return
* value from our stored package function.
private ResultSet retrieveRefCursor(Object qc,
String serialNum,
BigDecimal serialColCd,
BigDecimal maxRows,
BigDecimal totalRows,
String messageCd ) {
CallableStatement st = null;
try {
st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
* Register the first bind parameter as our return value of type CURSOR
st.registerOutParameter(1,OracleTypes.CURSOR);
* Set the value of the 2nd bind variable to pass id as argument
if (serialNum == null) st.setNull(2,Types.CHAR);
else st.setString(2,serialNum);
if (serialColCd == null) st.setNull(3,Types.NUMERIC);
else st.setBigDecimal(3,serialColCd);
if (maxRows == null) st.setNull(4,Types.NUMERIC);
else st.setBigDecimal(4,maxRows);
if (totalRows == null) st.setNull(5,Types.NUMERIC);
else st.setBigDecimal(5,totalRows);
if (messageCd == null) st.setNull(6,Types.CHAR);
else st.setString(6,messageCd);
st.execute();
ResultSet rs = ((OracleCallableStatement)st).getCursor(1);
* Make this result set use the fetch size from our View Object settings
rs.setFetchSize(getFetchSize());
return rs ;
catch (SQLException s) {
throw new JboException(s);
finally {try {st.close();} catch (SQLException s) {}}
* Store a new result set in the query-collection-private user-data context
private void storeNewResultSet(Object qc, ResultSet rs) {
ResultSet existingRs = getResultSet(qc);
// If this query collection is getting reused, close out any previous rowset
if (existingRs != null) {
try {existingRs.close();} catch (SQLException s) {}
setUserDataForCollection(qc,rs);
hasNextForCollection(qc); // Prime the pump with the first row.
* Retrieve the result set wrapper from the query-collection user-data
private ResultSet getResultSet(Object qc) {
return (ResultSet)getUserDataForCollection(qc);
* Return either null or a new oracle.jbo.domain.Number
private static oracle.jbo.domain.Number nullOrNewNumber(BigDecimal b) {
try {
return b != null ? new oracle.jbo.domain.Number(b) : null;
catch (SQLException s) { }
return null;
I created the view object in expert mode so there is no entity object. Can someone help? I don't have much time left to finish this.
Also, could I have done this from the Entity object instead of the view object by registering the ref cursor OUT parameter in handleStoredProcInsert()?
Thanks
NatalieI was able to get the input parameter by putting the following in my struts actions class
vo.setWhereClauseParam(0,request.getParameter("row0_SerialNum"));
The full code is:
package mypackage2;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import oracle.jbo.html.BC4JContext;
import oracle.jbo.ViewObject;
import oracle.jbo.html.struts11.BC4JUtils;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class LienCheckView1QueryAction extends Action
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
BC4JContext context = BC4JContext.getContext(request);
// Retrieve the view object instance to work with by name
ViewObject vo = context.getApplicationModule().findViewObject("LienCheckView1");
vo.setRangeSize(3);
vo.setIterMode(ViewObject.ITER_MODE_LAST_PAGE_PARTIAL);
// Do any additional VO setup here (e.g. setting bind parameter values)
vo.setWhereClauseParam(0,request.getParameter("row0_SerialNum"));
// default value for serialCollCd 1 is for Motor Vehicles
vo.setWhereClauseParam(1,new oracle.jbo.domain.Number(1));
// Default value for maxRows_allowed
vo.setWhereClauseParam(2,new oracle.jbo.domain.Number(20));
return BC4JUtils.getForwardFromContext(context, mapping);
This doesn't always work properly though. The first time I press the query button, the SerialNum parameter is still null, however if I re-execute the query by pressing the query button again. It will work, and return the rows. I always have to query twice. Also the SerialNum attribute is set to a String in my view object, it is a varchar column in the database, but some serial number I enter give a "Error Message: oracle.jbo.domain.Number ". This happens even though the underlying BC4J is returning values for the query. I also get a "500 Internal Server Error java.lang.ClassCastException: java.lang.String on my View object's code at line 65 which is
if (params.length>1) serialCollCdIn = (BigDecimal)params[1];
This is an input paramter to the oracle stored procedure that defaults to a Number value of 1.
Any idea what the problem is? Here is the full code for my view object:
package mypackage1;
import java.math.BigDecimal;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import oracle.jbo.JboException;
import oracle.jbo.domain.Number;
import oracle.jbo.server.DBTransaction;
import oracle.jbo.server.ViewObjectImpl;
import oracle.jbo.server.ViewRowImpl;
import oracle.jbo.server.ViewRowSetImpl;
import oracle.jdbc.driver.OracleCallableStatement;
import oracle.jdbc.driver.OracleTypes;
// --- File generated by Oracle Business Components for Java.
public class LienCheckViewImpl extends ViewObjectImpl
* This is the PLSQL block that we will execute to retrieve the REF CURSOR
private static final String SQL =
"begin pprs_test_wrappers.sn_srch_main_test(?, ?, ?, ?, ?, ?);end;";
private BigDecimal totalRows = null;
private String messageCd = null;
private BigDecimal serialColCd = null;
private BigDecimal maxRows = null;
public LienCheckViewImpl() {}
* Overridden framework method.
* Executed when the framework needs to issue the database query for
* the query collection based on this view object. One view object
* can produce many related result sets, each potentially the result
* of different bind variable values. If the rowset in query is involved
* in a framework-coordinated master/detail viewlink, then the params array
* will contain one or more framework-supplied bind parameters. If there
* are any user-supplied bind parameter values, they will *PRECEED* the
* framework-supplied bind variable values in the params array, and the
* number of user parameters will be indicated by the value of the
* numUserParams argument.
protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
* If there are where-clause params (for example due to a view link)
* they will be in the 'params' array.
* We assume that if some parameter is present, that it is a Deptno
* value to pass as an argument to the stored procedure.
* NOTE: Due to Bug#2828248 I have to cast to BigDecimal for now,
* ---- but this parameter value should be oracle.jbo.domain.Number type.
String serialNumIn = null;
BigDecimal serialCollCdIn = null;
BigDecimal maxRowsAllowed = null;
BigDecimal totalRowsSelected = null;
String messageCdOut = null;
if (params != null) {
if (params.length>0) serialNumIn = (String)params[0];
if (params.length>1) serialCollCdIn = (BigDecimal)params[1];
if (params.length>2) maxRowsAllowed = (BigDecimal)params[2];
storeNewResultSet(qc,retrieveRefCursor(qc,serialNumIn,
serialCollCdIn,
maxRowsAllowed));
super.executeQueryForCollection(qc, params, numUserParams);
* Overridden framework method.
* Wipe out all traces of a built-in query for this VO
protected void create() {
getViewDef().setQuery(null);
getViewDef().setSelectClause(null);
setQuery(null);
* Overridden framework method.
* The role of this method is to "fetch", populate, and return a single row
* from the datasource by calling createNewRowForCollection() and populating
* its attributes using populateAttributeForRow().
protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
* We ignore the JDBC ResultSet passed by the framework (null anyway) and
* use the resultset that we've stored in the query-collection-private
* user data storage
rs = getResultSet(qc);
* Create a new row to populate
ViewRowImpl r = createNewRowForCollection(qc);
try {
* Populate new row by attribute slot number for current row in Result Set
//AddedByRegisNum
populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
System.out.println("AddedByRegisNum :" + rs.getBigDecimal(1));
// OrigRegisNum
populateAttributeForRow(r,1, nullOrNewNumber(rs.getBigDecimal(2)));
System.out.println("OrigRegisNum :" + rs.getBigDecimal(2));
// SerialNum
populateAttributeForRow(r,2, rs.getString(3));
System.out.println("SerialNum :" + rs.getString(3));
// SerialNumDesc
populateAttributeForRow(r,3, rs.getString(4));
System.out.println("SerialNumDesc :" + rs.getString(4));
// FlagExactMatch
populateAttributeForRow(r,4, rs.getString(5));
System.out.println("FlagExactMatch :" + rs.getString(5));
// MessageCd
populateAttributeForRow(r,5, messageCd);
// TotalRows
populateAttributeForRow(r,6, totalRows);
catch (SQLException s) {
throw new JboException(s);
return r;
* Overridden framework method.
* Return true if the datasource has at least one more record to fetch.
protected boolean hasNextForCollection(Object qc) {
ResultSet rs = getResultSet(qc);
boolean nextOne = false;
try {
nextOne = rs.next();
* When were at the end of the result set, mark the query collection
* as "FetchComplete".
if (!nextOne) {
setFetchCompleteForCollection(qc, true);
* Close the result set, we're done with it
rs.close();
catch (SQLException s) {
throw new JboException(s);
return nextOne;
* Overridden framework method.
* The framework gives us a chance to clean up any resources related
* to the datasource when a query collection is done being used.
protected void releaseUserDataForCollection(Object qc, Object rs) {
* Ignore the ResultSet passed in since we've created our own.
* Fetch the ResultSet from the User-Data context instead
ResultSet userDataRS = getResultSet(qc);
if (userDataRS != null) {
try {
userDataRS.close();
catch (SQLException s) {
/* Ignore */
super.releaseUserDataForCollection(qc, rs);
* Overridden framework method
* Return the number of rows that would be returned by executing
* the query implied by the datasource. This gives the developer a
* chance to perform a fast count of the rows that would be retrieved
* if all rows were fetched from the database. In the default implementation
* the framework will perform a SELECT COUNT(*) FROM (...) wrapper query
* to let the database return the count. This count might only be an estimate
* depending on how resource-intensive it would be to actually count the rows.
public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
Object[] params = viewRowSet.getParameters(true);
String serialNumIn = (String)params[0];
BigDecimal serialCollCdIn = (BigDecimal)params[1];
BigDecimal maxRowsAllowed = (BigDecimal)params[2];
CallableStatement st = null;
try {
st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
* Register the fourth bind parameter as our return value of type NUMERIC
st.registerOutParameter(4,Types.NUMERIC);
* Set the value of the 3 bind variables to pass as arguments
if (serialNumIn == null) st.setNull(1, Types.CHAR);
else st.setString(1,serialNumIn);
if (serialCollCdIn == null) st.setNull(2,Types.NUMERIC);
else st.setBigDecimal(2,serialCollCdIn);
if (maxRowsAllowed == null) st.setNull(3, Types.NUMERIC);
else st.setBigDecimal(3, maxRowsAllowed);
st.execute();
System.out.println("returning value of :" + st.getLong(4));
return st.getLong(4);
catch (SQLException s) {
throw new JboException(s);
finally {try {st.close();} catch (SQLException s) {}}
* Return a JDBC ResultSet representing the REF CURSOR return
* value from our stored package function.
private ResultSet retrieveRefCursor(Object qc,
String serialNum,
BigDecimal serialColCd,
BigDecimal maxRows) {
CallableStatement st = null;
try {
st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
* Set the value of the bind variables
System.out.println("SerialNumIn :" + serialNum);
if (serialNum == null) st.setNull(1,Types.CHAR);
else st.setString(1,serialNum);
if (serialColCd == null) st.setNull(2,Types.NUMERIC);
else st.setBigDecimal(2,serialColCd);
if (maxRows == null) st.setNull(3,Types.NUMERIC);
else st.setBigDecimal(3,maxRows);
st.registerOutParameter(1, Types.CHAR); // serialNum
st.registerOutParameter(2, Types.NUMERIC); // serialColCd
st.registerOutParameter(3, Types.NUMERIC); // maxRows
st.registerOutParameter(4, Types.NUMERIC); // totalRows
st.registerOutParameter(5, Types.CHAR); // messageCd
* Register the 6th bind parameter as our return value of type CURSOR
st.registerOutParameter(6,OracleTypes.CURSOR);
st.execute();
ResultSet rs = ((OracleCallableStatement)st).getCursor(6);
serialColCd = st.getBigDecimal(2);
System.out.println("SerialColCd= " + serialColCd);
maxRows = st.getBigDecimal(3);
System.out.println("maxRows= " + maxRows);
totalRows = st.getBigDecimal(4);
System.out.println("totalRows= " + totalRows);
messageCd = st.getString(5);
System.out.println("messageCd= " + messageCd);
* Make this result set use the fetch size from our View Object settings
rs.setFetchSize(getFetchSize());
return rs ;
catch (SQLException s) {
throw new JboException(s);
finally {try {st.close();} catch (SQLException s) {}}
* Store a new result set in the query-collection-private user-data context
private void storeNewResultSet(Object qc, ResultSet rs) {
ResultSet existingRs = getResultSet(qc);
// If this query collection is getting reused, close out any previous rowset
if (existingRs != null) {
try {existingRs.close();} catch (SQLException s) {}
setUserDataForCollection(qc,rs);
hasNextForCollection(qc); // Prime the pump with the first row.
* Retrieve the result set wrapper from the query-collection user-data
private ResultSet getResultSet(Object qc) {
return (ResultSet)getUserDataForCollection(qc);
* Return either null or a new oracle.jbo.domain.Number
private static oracle.jbo.domain.Number nullOrNewNumber(BigDecimal b) {
try {
return b != null ? new oracle.jbo.domain.Number(b) : null;
catch (SQLException s) { }
return null;
Natalie -
WebToGo BC4J + Struts + UIX application
Is there any possibility to write a complete BC4J + Struts + UIX web application to run in the Oracle Lite platform??
The documentation says about implementing a Servlet, but is it possible to install the .jar files of the struts & uix frameworks and register the *.do & *.uix extensions? What is the specification of the HttpServlet to be implemented?
What about performance? Could this combination run in a WinXP PIV offline Laptop with reasonable performance?
Where can I find this kind of information??
Thanks
EduardoUIX is not supported in 5.0.2.x release. The next release (10g) will have complete UIX support. Beta release of 10g is already out in case you are interested in trying UIX with it.
For BC4J refer to 'Chapter 6 BC4J Tutorial' of 'Oracle9i Lite Developers Guide'
Limited support for Struts is there in 5.0.2.10.0 release. If you have the handler for .do extension files then you can use following:
You can add mime handler to Mobile Server for .do extension by using a ini file. Copy following lines in a file called addmime.ini
[DATABASE]
TYPE=ORACLE
[MIMETYPES]
NAME = do
VALUE=text/html
PLUGIN=<handler class name>
and run this ini file as following
wsh -c addmime.ini mobileadmin/[email protected] -
Deployment of BC4J/JSP/Struts application to tomcat-4.18
Hi,
I made an application with BC4J/Struts, with embedded OC4J Server the application work fine but when I deploy the application to tomcat-4.18 I get the following error in the Edit page :
javax.servlet.jsp.JspTagException: Illegal to flush within a custom tag
at oracle.jbo.html.jsp.datatags.ComponentTag.doStartTag(ComponentTag.java:75)
at org.apache.jsp.automate_edit_jsp._jspx_meth_jbo_DataEdit_0(automate_edit_jsp.java:421)
at org.apache.jsp.automate_edit_jsp._jspx_meth_uix_rawText_0(automate_edit_jsp.java:395)
at org.apache.jsp.automate_edit_jsp._jspx_meth_uix_contents_0(automate_edit_jsp.java:367)
at org.apache.jsp.automate_edit_jsp._jspx_meth_uix_pageLayout_0(automate_edit_jsp.java:201)
at org.apache.jsp.automate_edit_jsp._jspService(automate_edit_jsp.java:146)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.Long postings are being truncated to ~1 kB at this time.Please see the online help for deploying JSP web applications. The instructions are under User Guides, Developing Web Applications, Developing JSPs and Servlets...
There are a number of dependency archives that need to be deployed to your webserver in order for the BC4J JSPs to run correctly.
IF you look at the Project Properties for your JSP project, you will see a number of them such as Connection Manager, ORacl e8.1.5 JDBC, etc. EAch of these libraries is based on one or more .jar or .zip files which need to be present in your webserver.
Which ones you deploy somewhat depends on how you have deployed your Business Components app module. The online help provides more details.
The Oracle JDBC classes are all located in <JDEV_HOME>/jdbc/lib/oraclex.x.x/classes111.zip. Where x.x.x is the version of the drivers. 8.1.5 is the default in JDev 2. and 3.0.
Laura -
Java.lang.ClassCastException in simple struts application. please help me!
I have a simple struts application, it only have a login form. however, it's alway throw java.lang.ClassCastException when I submit the form. Here is full stack trace:
14-03-2007 17:04:50 org.apache.struts.chain.ComposableRequestProcessor init
INFO: Initializing composable request processor for module prefix ''
14-03-2007 17:04:50 org.apache.struts.chain.commands.servlet.CreateAction getAction
INFO: Initialize action of type: ndlinh.struts.lab.RegistrationForm
14-03-2007 17:04:50 org.apache.struts.chain.commands.AbstractExceptionHandler execute
WARNING: Unhandled exception
java.lang.ClassCastException: ndlinh.struts.lab.RegistrationForm
at org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:66)
at org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:82)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
14-03-2007 17:04:50 org.apache.struts.chain.commands.ExceptionCatcher postprocess
WARNING: Exception from exceptionCommand 'servlet-exception'
java.lang.ClassCastException: ndlinh.struts.lab.RegistrationForm
at org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:66)
at org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:82)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Here is my code:
package ndlinh.struts.lab;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
public class RegistrationForm extends ActionForm {
private String userid = null;
private String password = null;
private String password2 = null;
public RegistrationForm() {
System.out.println("************ Registration Form created *************");
* @return the password
public String getPassword() {
return password;
* @param password the password to set
public void setPassword(String password) {
this.password = password;
* @return the password2
public String getPassword2() {
return password2;
* @param password2 the password2 to set
public void setPassword2(String password2) {
this.password2 = password2;
* @return the userid
public String getUserid() {
return userid;
* @param userid the userid to set
public void setUserid(String userid) {
this.userid = userid;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
userid = "";
password = "";
password2 = "";
package ndlinh.struts.lab;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public final class RegistrationAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse response)
try {
System.out.println("*******************" + actionForm.toString() + "*******************");
RegistrationForm form = (RegistrationForm)actionForm;
String username = form.getUserid();
String password = form.getPassword();
System.out.println(username);
// simple login checking.
// if userid equals password, user can login to system
if ( username.equalsIgnoreCase(password)) {
return mapping.findForward("success");
} else {
return mapping.findForward("failure");
} catch (Exception e) {
e.printStackTrace();
return mapping.findForward("failure");
}registration.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<html:form action="/register">
Username: <html:text property="userid" /> <br />
Password: <html:password property="password" /> <br />
Re-type: <html:password property="password2" />
<html:submit value="Register" />
</html:form>
</body>
</html>struts-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="registrationForm" type="ndlinh.struts.lab.RegistrationForm" />
</form-beans>
<action-mappings>
<action path="/register"
type="ndlinh.struts.lab.RegistrationForm"
name="registrationForm"
validate="false"
scope="request"
input="registration.jsp" >
<forward name="success" path="/jsp/success.jsp" />
<forward name="failure" path="/jsp/failure.jsp" />
</action>
</action-mappings>
</struts-config>web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>System information:
Tomcat 5.5.20
Struts 1.3.5
JDK1.5.08struts-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="registrationForm" type="ndlinh.struts.lab.RegistrationForm" />
</form-beans>
<action-mappings>
<action path="/register"
type="ndlinh.struts.lab.RegistrationAction" // action class
name="registrationForm" // form bean name
validate="false"
scope="request"
input="registration.jsp" >
<forward name="success" path="/jsp/success.jsp" />
<forward name="failure" path="/jsp/failure.jsp" />
</action>
</action-mappings>
</struts-config>HTH -
Display the id of new Record in the browse page of BC4J Struts App
I am working on an application using BC4J Struts with backbone on Oracle 8i.I am using DBSequence Type for my Employee ID.Since I am using this Id as search criteria for employee, I want to show Employee Id after insertion of new Employee.How can I display this ID to the user after insertion of new employee...
Hi and welcome,
please find a technical forum that matches to your question. Certification is the wrong forum.
Mod: I'm locking this OT thread. -
Guys,
I am starting on a new project which is likely to be a fairly standard mvc -> session bean facade -> DAO/Entity bean type architecture. As we will be using 9ias, I was wondering whether it would worth using BC4J or whether to write everything ourselves albeit using open source stuff like Struts and ofbiz.
I was hoping to be able to find a GOOD BC4J sample application ie something like PetStore, just to see how this type of architecture could be implemented with BC4J. I have read Steve Muench's article on j2EE/BC4J which is very good but the examples are quite sparse and simplistic.
Any info would be much appreciated.
Thanks,
JohnOf course, writing everything by hand is always your choice, but here's another article that more specifically talks about how BC4J can automate the typical J2EE application for you:
Re: Problem when connect to OC4J.
We're working now on a re-implementation of our Virtual Shopping Mall demo (using BC4J instead of raw EJB plus hand-written design pattern code) to concretely illustrate how much less hand-written code is required when using BC4J to implement the same J2EE application using the same J2EE design patterns. -
Hi folks,
How would I achieve a polling functionality? One of our applications is setup with the 10gR2 version which comes with BC4J and Struts(Struts was a personal choice). I understand we have an af:poll tag with jsf which helps us to achieve the polling functionality. My query is how would I go about doing the same thing through Struts and BC4j. We don't have JSF, so its kind of tricky.
My actual requirement is as follows:-
I basically need to call an oracle report from java. I do this by having a custom implementation of the rwservlet. The oracle report generates a PDF file locally. Which I then need to store on my Database as a BLOB.
I know how to call the report.
I know where the pdf is located.
I know how to store and retrieve the pdf from the DB through Struts.
My only issues is in instructing my application from the report side to pick up the pdf file when the report is complete. I was thinking in these lines:-
Rather than passing the instruction from the report side,in my struts action class i would set up some polling mechanism(which i don't know how to) that would tell me to look for the report in 2 minutes(which is how long the report takes to be generated), then pick it up and store it onto the DB.
Since i "lose control" of the handle after redirecting to a different servlet for the report call, I don't see another alternative other than polling.
Is there an alternative approach i can adopt to achieve the above functionality?
If not, is it possible to poll through BC4J/Struts (as against ADF/JSF)?
If not, please help :) .
Cheers,
KThere is another danger related to this security hole:
Struts suggests to locate JSPs below the WEB-INF directory to protect them from direct access. A JSP located here cannot be accessed directly but only using the appropriate action.
One common approach implement security in a struts framework is to perform the required checks in actions. A user not logged in might for example been forwarded to the login screen instead of the requested page.
If an Application relies on this fact and assumes that it is not possible to call a JSP located in WEB-INF without using the appropriate actions, this bug here opens another hole:
The "currentPath" Parameter allows a user to call any JSP on your Web-Server! Simply modify the URL to look like this:
navigate.do?amId=...&jboViewObject=...¤tPath=WEB-INF\path\to\any\page.jsp
and you are in!
Frank Brandstetter -
Exception while running STRUTS application???
HI,
This is my 2nd post regarding my struts application, previous error was solved, but when i'm tryin to run my application with tomcat i'm getting error(plz help me tellin what changes i've to do in my application).It is actually the first page of the application which is a simple index.jsp, from where i've links to other main pages.The error i'm getting is:-
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:521)
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:436)
org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:495)
org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:353)
org.apache.jsp.index_jsp._jspx_meth_html_link_0(index_jsp.java:96)
org.apache.jsp.index_jsp._jspService(index_jsp.java:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs.
Apache Tomcat/5.0.27Here i'm posting my index.jsp(where link tag is used), search.jsp, web.xml and struts.xml.frm index.jsp i just want to go to search.jasp frm where all the real thing will start.plz have look on all these files and let me no where i'm wrong.
index.jsp :-
<%@ page langiuage="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<title>Gaurav, Human Resource Portal</title>
<head>
<body>
<font size="+1"><b>Gaurav Human Resource Portal</b></font><br>
<hr wodth="100%" noshade="true">
• Add an Employee<br>
•<html:link forward="search">Search for Employees</html:link><br>
</body>
</html>
search.jsp :-
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html>
<head>
<title>Gaurav, Human Resource Portal</title>
</head>
<body>
<font size="+1"><b>Gaurav, Human Resource Portal - search.jsp</b></font>
<hr width="100%" noshade="true">
<html:errors/>
<html:form action="/search">
<table>
<tr>
<td align="right"><bean:message key="label.search.name"/>:</td>
<td><html:text property="name"/></td>
</tr>
<tr>
<td></td>
<td>--- or ---</td>
</tr>
<tr>
<td align="right"><bean:message key="label.search.ssNum"/>:</td>
<td><html:text property="ssNum"/> (xxx-xx-xxxx)</td>
</tr>
<tr>
<td></td>
<td><html:submit/></td>
</tr>
</table>
</html:form>
<logic:present name="searchForm" property="results">
<hr width="100%" size="1" noshade="true">
<bean:size id="size" name"searchForm" property="results"/>
<logic:equal name="size" value="0">
<center><font color="red"><b>No Employees Found</b></font></center>
</logic:equal>
<logic:greaterThan name="size" value="0">
<table border="1">
<tr>
<th>Name</th>
<th>Social Security number</th>
</tr>
<logic:iterate id="result" name="searchForm" property="results">
<tr>
<td><bean:write name="result" property="name"/></td>
<td><bean:write name="result" property="ssNum"/></td>
</tr>
</logic:iterate>
</table>
</logic:greaterThan>
</logic:present>
</body>
</html>
web.xml :-
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>Gaurav MiniHR Portal</display-name>
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
</web-app>
struts-config.xml :-
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<!-- ==========Form Beans configuration section.(i.e ActionForm objects)========== -->
<form-beans>
<form-bean name="searchForm" type="com.jamesholmes.minihr.SearchForm" />
</form-beans>
<global-forwards>
<forward name="search" path="/search.jsp" />
</global-forwards>
<!-- =================================== Action Mapping Definitions -->
<action-mappings>
<action path="/search"
type="com.jamesholmes.minih.SearchAction"
name="searchForm"
scope="request"
validat="true"
input="/search.jsp"
</action>
</action-mappings>
<!-- ================================ Message Resources Definitions -->
<message-resources parameter="com.jamesholmes.minihr.ApplicationResources"/>
</struts-config> -
BC4J/Struts Integration classes
Does anyone know of any documentation on the BC4J classes that are used in Jdeveloper for struts integration?
I have access to the source that came packaged in jdeveloper but I still have questions about the classes BC4JActionMapping,BC4JRequestProcessor,BC4JActionForm,BC4JUtils,BC4JContext, and HTTPContainer.
One of my initial questions is whether I should specify the view object name I'm using in an action in my struts-config.xml file as I do with the application module? Also, when I do this how do I programmatically access it.
I'm also interested in how the BC4J Client Data Model ".cpx" is used and if this needs to be packaged when deploying a bc4j/struts web application.
The postings at Re: re:Using Struts without Datatags <jbo:xxx> by Steven Muench were terrific. A great start for understanding the integration of the two technologies. I would just like more detail on how/why bc4j leverages struts extension points.
Thanks in advance!part 2 of posting:
<action path="/navigateEmpView1" parameter="jboEvent" type="oracle.jbo.html.struts11.actions.NavigationAction">
<set-property property="viewobject" value="EmpView1"/>
<set-property property="application" value="Mypackage1Module"/>
<set-property property="releasemode" value="Stateful"/>
</action>
Since NavigationAction is a Struts DispatchAction (instead of calling the execute method on the action, the method name to execute is passed using a request parameter), you will need to specify the event name on the request with the URL:
/nextEmpView1.do?jboEvent=next
To understand how this work, you need to look at how the BC4JContext is initialized:
The following code is extracted from BC4JrequestProcessor:
BC4JContext context = (BC4JContext)request.getAttribute(BC4JContext.ContextAttrName);
// Instantiate the context and save it on the request
if (context == null)
context = new BC4JContext();
request.setAttribute(BC4JContext.ContextAttrName, context);
if (initPageFromPath(bc4jMapping, request, response))
// First initialize context with the existing mapping values
bc4jMapping.initializeContext(request, response, context);
// Then use request para[i]Long postings are being truncated to ~1 kB at this time. -
Link for BC4J Struts-JSP and Tiles
Hi,
I have a JSP-Struts application. By the default generation, JDeveloper build a main.html Page. This page have many Frames and one Frame is "navFrame". On this frame I have a link for a JSP Page : Browse. The call is OK. No Problems.
No I have another Page with Tiles :
<template:insert page="IMDLayout.jsp" flush="true">
<template:put name="title" value="Invoices Interface" />
<template:put name="header" value="/tiles/common/header.jsp" />
<template:put name="footer" value="/tiles/common/footer.jsp" />
<template:put name="menu" value="/tiles/common/menu.jsp" />
<template:put name="body" value="VInvoiceUsersView1_Browse.do" />
</template:insert>
The "body" Tiles call the same JSP Page as the link on the "navFrame", but now I have the following error :
[ServletException in:VInvoiceUsersView1_Browse.do] Response has already been committed'
Why ?
Please help me, I need a solution. Does somebody use BC4J/Struts/Tiles ? Any Experience ? Problem ?
Thanks
YvesRepost
-
Struts Application: Binding TextArea to Checkbox. Please Help!!!
Hi
I am working on a Struts Application, where I have to do the following function
There is a JSP Page which i have created. The JSP page has these elements. It is basically a page with which a user can specify what problem he/she has and can use the checkbox to check off the problem. The user also has a textarea, using which he/she can write their own version of the problem and submit the page. The page contains many textareas and checkboxes. I am using Struts and was reading about the Multibox usage in Struts. Can you please tell me how I can apply it in this area to bind a particular checkbox to a textarea.
Here is some of the JSP Code
<form name="re1ActionItems" method="post" action="req1ActionRegEntry.do">
<table width="907" height="667" border="1">
<tr>
<th width="578" scope="col">Nature of the Problem </th>
<th width="432" scope="col">Check</th>
</tr>
<tr>
<td height="53">There is no Firewall Configuration Standard OR There is an improperly drafted Firewall Configuration Standard </td>
<td><textarea name="fwConfig" cols="30" rows="4"><bean:message key="ate.fwConfig"/></textarea>
<input name="noFwConfig" type="checkbox" value="yes"></td>
</tr>
<tr>
<td>There is no DMZ which has been established for housing Public Facing Servers </td>
<td><textarea name="noDmzTxt" cols="30" rows="4"><bean:message key="ate.noDmz"/></textarea>
<input name="noDmz" type="checkbox" value="yes"></td>
</tr>
<tr>
<td>Firewall rules contains Any-Any rules, or there are no IP and Port Specific Rules which have been configured on the Firewall(s)</td>
<td><textarea name="anyAnyFwTxt" cols="30" rows="4"><bean:message key="ate.anyAnyFw"/></textarea>
<input name="anyAnyFw" type="checkbox" value="yes"></td>Can you please help me out with this issue.
P.S. I would not like to use Client Side Scripting to sort out this problem, please try and give me something which I can use Server side.I presume your form is being stored in session scope?
It is for this purpose that struts has a "reset()" method.
Have the reset method set the boolean to false every time.
It will be set to true if the checkbox is checked, otherwise it will be left as false. -
Setting Beans in Application Scope
How do I set beans in application scope at the start of a JSF web app? I'd like to be able to do something similar to the Struts plugin.
Hi,
I also tried to use a servletcontextlistener. The problem is, that I cannot
put any beans in the facescontext, because a NullpointerExcpetion
is thrown. In the contextInitialized-Method I do the following:
FacesContext context = FacesContext.getCurrentInstance();
ApplicationFactory factory =
(ApplicationFactory) FactoryFinder.getFactory(
FactoryFinder.APPLICATION_FACTORY);
Application application = factory.getApplication();
ValueBinding binding = application.createValueBinding( "#{Bean}" );
In the createValueBinding-method a Exception is thrown. So I cannot call
createValueBinding when I am not in a facescontext.
Can anyone help me?
Thanks
Andy -
Error while deploying struts application in tomcat
Hi,
I'm getting the following error when I start Tomcat using while auto-deploying a struts application.
2005-09-21 15:28:17 - ContextManager: Adding DEFAULT:/cna
2005-09-21 15:28:18 - Ctx(/cna) : Validating web.xml
2005-09-21 15:28:18 - Ctx(/cna) : Class not found: org.apache.struts.action.Acti
onServlet
2005-09-21 15:28:18 - Ctx(/cna) : Class not found: org.apache.axis.transport.htt
p.AdminServlet
In case anyone is aware how to resolve this issue, please help.
Thanks,
RoselineHi,
1] Remove following from server.xml
<Context path="/SEA" docBase="SEA" debug="0"/>
2] Paste SEA.WAR (test WAR file) into /webapps of TOMCAT
3] Start Tomcat Server - This will create SEA folder under webapps
4] Stop server.
5] Add following to server.xml
<Context path="/SEA" docBase="SEA" debug="0"/>
6] Start Tomcat Server
7] Access the URL.
This will work. Somehow Tomcat does not extract war file contents which are mentioned in server.xml.
I have Apache Tomcat 4.0.3 and faced this problem. The above solution works for it.
Regards,
Sandesh
hi.
I have put my SEA.WAR (test WAR file) into /webapps of
TOMCAT.
I checked the server.xml and put:
<Context path="/SEA" docBase="SEA" debug="0"/>
I restarted TOMCAT and tried to execute the file:
http://localhost:8080/SEA/index.jsp
But I got error message:
Apache Tomcat/4.0.3 - HTTP Status 404 -
/SEA/index.jsp
What was happenning?
Anyone can help me?
Thank you. -
Error while deploying struts application
Hi every body,
I am new for struts application. While i deploying my application, the following error is comming any body give a remedy to me...
Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: File "/WEB-INF/struts-html.tld" not found
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:214)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1170)
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:765)
at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:125)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:214)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)
--------------------------------------------------------------------------------Hi every body,
I am new for struts application. While i deploying my
application, the following error is comming any body
give a remedy to me...
Apache Tomcat/4.0.4 - HTTP Status 500 - Internal
Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error
(Internal Server Error) that prevented it from
fulfilling this request.
exception
org.apache.jasper.JasperException: File
"/WEB-INF/struts-html.tld" not found
at
t
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibr
aryInfoImpl.java:214)
at
t
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibr
aryInfoImpl.java:174)
at
t
org.apache.jasper.compiler.JspParseEventListener.proce
ssTaglibDirective(JspParseEventListener.java:1170)
at
t
org.apache.jasper.compiler.JspParseEventListener.handl
eDirective(JspParseEventListener.java:765)
at
t
org.apache.jasper.compiler.DelegatingListener.handleDi
rective(DelegatingListener.java:125)
at
t
org.apache.jasper.compiler.Parser$Directive.accept(Par
ser.java:255)
at
t
org.apache.jasper.compiler.Parser.parse(Parser.java:11
45)
at
t
org.apache.jasper.compiler.Parser.parse(Parser.java:11
03)
at
t
org.apache.jasper.compiler.Parser.parse(Parser.java:10
99)
at
t
org.apache.jasper.compiler.ParserController.parse(Pars
erController.java:214)
at
t
org.apache.jasper.compiler.Compiler.compile(Compiler.j
ava:210)
at
t
org.apache.jasper.servlet.JspServlet.loadJSP(JspServle
t.java:548)
at
t
org.apache.jasper.servlet.JspServlet$JspServletWrapper
.loadIfNecessary(JspServlet.java:176)
at
t
org.apache.jasper.servlet.JspServlet$JspServletWrapper
.service(JspServlet.java:188)
at
t
org.apache.jasper.servlet.JspServlet.serviceJspFile(Js
pServlet.java:381)
at
t
org.apache.jasper.servlet.JspServlet.service(JspServle
t.java:473)
at
t
javax.servlet.http.HttpServlet.service(HttpServlet.jav
a:853)
at
t
org.apache.catalina.core.ApplicationFilterChain.intern
alDoFilter(ApplicationFilterChain.java:247)
at
t
org.apache.catalina.core.ApplicationFilterChain.doFilt
er(ApplicationFilterChain.java:193)
at
t
org.apache.catalina.core.StandardWrapperValve.invoke(S
tandardWrapperValve.java:243)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:566)
at
t
org.apache.catalina.core.StandardPipeline.invoke(Stand
ardPipeline.java:472)
at
t
org.apache.catalina.core.ContainerBase.invoke(Containe
rBase.java:943)
at
t
org.apache.catalina.core.StandardContextValve.invoke(S
tandardContextValve.java:190)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:566)
at
t
org.apache.catalina.valves.CertificatesValve.invoke(Ce
rtificatesValve.java:246)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:564)
at
t
org.apache.catalina.core.StandardPipeline.invoke(Stand
ardPipeline.java:472)
at
t
org.apache.catalina.core.ContainerBase.invoke(Containe
rBase.java:943)
at
t
org.apache.catalina.core.StandardContext.invoke(Standa
rdContext.java:2347)
at
t
org.apache.catalina.core.StandardHostValve.invoke(Stan
dardHostValve.java:180)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:566)
at
t
org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:564)
at
t
org.apache.catalina.valves.ErrorReportValve.invoke(Err
orReportValve.java:170)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:564)
at
t
org.apache.catalina.valves.AccessLogValve.invoke(Acces
sLogValve.java:468)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:564)
at
t
org.apache.catalina.core.StandardPipeline.invoke(Stand
ardPipeline.java:472)
at
t
org.apache.catalina.core.ContainerBase.invoke(Containe
rBase.java:943)
at
t
org.apache.catalina.core.StandardEngineValve.invoke(St
andardEngineValve.java:174)
at
t
org.apache.catalina.core.StandardPipeline.invokeNext(S
tandardPipeline.java:566)
at
t
org.apache.catalina.core.StandardPipeline.invoke(Stand
ardPipeline.java:472)
at
t
org.apache.catalina.core.ContainerBase.invoke(Containe
rBase.java:943)
at
t
org.apache.catalina.connector.http.HttpProcessor.proce
ss(HttpProcessor.java:1027)
at
t
org.apache.catalina.connector.http.HttpProcessor.run(H
ttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)
--------------------------i am try to run struts application. but it shows following error
org.apache.jasper.JasperException: File "/WEB-INF/struts-html.tld" not found
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Maybe you are looking for
-
Exception While importing or unable to browse the xsd to a BPEL Project
Dear All.., I am having an issue wjile importing the schema to a BPEL project. It says that unable to load the schema. Even When I try to choose the schema through edit variable option, and to mention the URI of schema location, on click of the searc
-
Problem with sheduler (DBMS_JOB)
Hi All, I have scheduled one procedure through dbms_job when i use the query, exec dbms_job.run(142); i got the following output select LAST_DATE,LAST_SEC, THIS_DATE,THIS_SEC,NEXT_DATE,NEXT_SEC from user_jobs where job=141; LAST_DATE LAST_SEC THIS_DA
-
Beginner:an issue of generating code for an entity service
Hi All, I have downloaded Sap Netweaver of sneak preview version which contains netweaver studio 7.0.07. And my jdk version is 1.4.09. I created a CAF project and added an entity service named Person(just by clicking mouse,not did anything else).
-
how to remove jailbreak from my iphone4 (5.1)? .. i want the original setting like a new iphone..please tell?
-
Désimlocker Iphone 4S pour utilisation en Nouvelle-Calédonie
Bonjour, Ai acheté le 17/01/2012 un iphone 4S (chez SFR) en france et je cherche à le désimlocker depuis la Nouvelle-Calédonie. Pourriez-vous m'aider SVP! On m'a dis qu'il faut attendre trois mois (ok délais passé), et ensuite contacté SFR pour avoir