You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chuck Amadi <ch...@breconbeacons.org> on 2001/07/25 14:59:30 UTC

ActionForward.java [11:1] 'class' or 'interface' keyword expected.

Hi again i have one error but this is the example from 2.6 Accessing
Relational Databases found within the struts - documentation. Any
Pointers as i assumed that Action.class was the interface/abstract class
and thus i am totally confused.

ActionFoward at the below address.

file:///C|/jakarta-tomcat-3.2.2/webapps/struts-documentation/userGuide/building_model.html
---------------------------------------------------------------------------------------------------
WEB-INF/classes/org/apache/struts/action/ActionForward.java [11:1]
'class' or 'interface' keyword expected.
    public ActionForward  
           ^
1 error
Errors compiling ActionForward.

--------------------------------------------------------------------------------------------------
package classes.org.apache.struts.action;

/*Accessing Relational Databases
 *Struts can define the datasources for an application from within its
standard configuration file. A simple JDBC connection pool is also
provided.
 *See The Action Mappings Configuration File section and the Utilities
Developer Guide for details.
 *After the datasource is defined, here is an example of establishing a
connection from within a Action perform method.*/
    
    


    public ActionForward  ---------------------//  public ActionForward
(class/interface) ??
        perform (ActionMapping mapping,
                ActionForm form,
                HttpServletRequest request,
                HttpServletResponse response){
        try {
                javax.sql.DataSource dataSource =
                servlet.findDataSource(null);
                java.sql.Connection myConnection =
                dataSource.getConnection();
            
            //do what you wish with myConnection
        } catch (SQLException sqle) {
            getServlet().log("Connection.process", sqle);
        } finally {
            
            //enclose this in a finally block to make
            //sure the connection is closed
            try {
                myConnection.close();
            } catch (SQLException e) {
                getServlet().log("Connection.close", e);
            }
        }
    }

Cheers Chuckie
-- 

The views expressed by the sender of this message don't 
necessarily represent those of Brecon Beacons National Park 
Authority. This message is intended for the addressee(s) only 
and is sent in confidence; if you receive it in error, please can you 
let us know (at it@breconbeacons.org) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn 
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. 
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion 
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn 
mewn camgymeriad, a fyddech gystal â rhoi gwybod i 
ni (yn it@breconbeacons.org) ac yna dilëwch bob copi.

Re: ActionForward.java [11:1] 'class' or 'interface' keyword expected.

Posted by Chuck Amadi <ch...@breconbeacons.org>.
Hi , again i have been told that these type of queries/problems should
be directed at java-user group. Thus i shall subscribe i only know the
basic fundamentals to java thus i find it misleading when one who has a
problem trying to construct a web development project that contains
Controller components that struts includes & promotes with it's servlets
that implements the Action.class that this is the wrong group as the
Building Controller Components is fundamental to MVC.
So apologize for posting so many queries but this user group did get up
and running .
So i'll be back with only struts queries cheers all.

suhas wrote:
> 
> ActionForward is  class  -
> public class ActionForward
> 
> Suhas
> ----- Original Message -----
> From: Chuck Amadi <ch...@breconbeacons.org>
> To: <st...@jakarta.apache.org>
> Sent: Wednesday, July 25, 2001 6:29 PM
> Subject: ActionForward.java [11:1] 'class' or 'interface' keyword expected.
> 
> > Hi again i have one error but this is the example from 2.6 Accessing
> > Relational Databases found within the struts - documentation. Any
> > Pointers as i assumed that Action.class was the interface/abstract class
> > and thus i am totally confused.
> >
> > ActionFoward at the below address.
> >
> >
> file:///C|/jakarta-tomcat-3.2.2/webapps/struts-documentation/userGuide/build
> ing_model.html
> > --------------------------------------------------------------------------
> -------------------------
> > WEB-INF/classes/org/apache/struts/action/ActionForward.java [11:1]
> > 'class' or 'interface' keyword expected.
> >     public ActionForward
> >            ^
> > 1 error
> > Errors compiling ActionForward.
> >
> > --------------------------------------------------------------------------
> ------------------------
> > package classes.org.apache.struts.action;
> >
> > /*Accessing Relational Databases
> >  *Struts can define the datasources for an application from within its
> > standard configuration file. A simple JDBC connection pool is also
> > provided.
> >  *See The Action Mappings Configuration File section and the Utilities
> > Developer Guide for details.
> >  *After the datasource is defined, here is an example of establishing a
> > connection from within a Action perform method.*/
> >
> >
> >
> >
> >     public ActionForward  ---------------------//  public ActionForward
> > (class/interface) ??
> >         perform (ActionMapping mapping,
> >                 ActionForm form,
> >                 HttpServletRequest request,
> >                 HttpServletResponse response){
> >         try {
> >                 javax.sql.DataSource dataSource =
> >                 servlet.findDataSource(null);
> >                 java.sql.Connection myConnection =
> >                 dataSource.getConnection();
> >
> >             file://do what you wish with myConnection
> >         } catch (SQLException sqle) {
> >             getServlet().log("Connection.process", sqle);
> >         } finally {
> >
> >             file://enclose this in a finally block to make
> >             file://sure the connection is closed
> >             try {
> >                 myConnection.close();
> >             } catch (SQLException e) {
> >                 getServlet().log("Connection.close", e);
> >             }
> >         }
> >     }
> >
> > Cheers Chuckie
> > --
> >
> > The views expressed by the sender of this message don't
> > necessarily represent those of Brecon Beacons National Park
> > Authority. This message is intended for the addressee(s) only
> > and is sent in confidence; if you receive it in error, please can you
> > let us know (at it@breconbeacons.org) and then destroy all copies.
> > Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
> > adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
> > Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
> > yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
> > mewn camgymeriad, a fyddech gystal  rhoi gwybod i
> > ni (yn it@breconbeacons.org) ac yna dilwch bob copi.
> >

-- 
The views expressed by the sender of this message don't 
necessarily represent those of Brecon Beacons National Park 
Authority. This message is intended for the addressee(s) only 
and is sent in confidence; if you receive it in error, please can you 
let us know (at it@breconbeacons.org) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn 
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. 
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion 
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn 
mewn camgymeriad, a fyddech gystal â rhoi gwybod i 
ni (yn it@breconbeacons.org) ac yna dilëwch bob copi.

Re: ActionForward.java [11:1] 'class' or 'interface' keyword expected.

Posted by suhas <su...@techmas.hcltech.com>.
ActionForward is  class  -
public class ActionForward

Suhas
----- Original Message -----
From: Chuck Amadi <ch...@breconbeacons.org>
To: <st...@jakarta.apache.org>
Sent: Wednesday, July 25, 2001 6:29 PM
Subject: ActionForward.java [11:1] 'class' or 'interface' keyword expected.


> Hi again i have one error but this is the example from 2.6 Accessing
> Relational Databases found within the struts - documentation. Any
> Pointers as i assumed that Action.class was the interface/abstract class
> and thus i am totally confused.
>
> ActionFoward at the below address.
>
>
file:///C|/jakarta-tomcat-3.2.2/webapps/struts-documentation/userGuide/build
ing_model.html
> --------------------------------------------------------------------------
-------------------------
> WEB-INF/classes/org/apache/struts/action/ActionForward.java [11:1]
> 'class' or 'interface' keyword expected.
>     public ActionForward
>            ^
> 1 error
> Errors compiling ActionForward.
>
> --------------------------------------------------------------------------
------------------------
> package classes.org.apache.struts.action;
>
> /*Accessing Relational Databases
>  *Struts can define the datasources for an application from within its
> standard configuration file. A simple JDBC connection pool is also
> provided.
>  *See The Action Mappings Configuration File section and the Utilities
> Developer Guide for details.
>  *After the datasource is defined, here is an example of establishing a
> connection from within a Action perform method.*/
>
>
>
>
>     public ActionForward  ---------------------//  public ActionForward
> (class/interface) ??
>         perform (ActionMapping mapping,
>                 ActionForm form,
>                 HttpServletRequest request,
>                 HttpServletResponse response){
>         try {
>                 javax.sql.DataSource dataSource =
>                 servlet.findDataSource(null);
>                 java.sql.Connection myConnection =
>                 dataSource.getConnection();
>
>             file://do what you wish with myConnection
>         } catch (SQLException sqle) {
>             getServlet().log("Connection.process", sqle);
>         } finally {
>
>             file://enclose this in a finally block to make
>             file://sure the connection is closed
>             try {
>                 myConnection.close();
>             } catch (SQLException e) {
>                 getServlet().log("Connection.close", e);
>             }
>         }
>     }
>
> Cheers Chuckie
> --
>
> The views expressed by the sender of this message don't
> necessarily represent those of Brecon Beacons National Park
> Authority. This message is intended for the addressee(s) only
> and is sent in confidence; if you receive it in error, please can you
> let us know (at it@breconbeacons.org) and then destroy all copies.
> Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
> adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
> Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
> yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
> mewn camgymeriad, a fyddech gystal â rhoi gwybod i
> ni (yn it@breconbeacons.org) ac yna dilëwch bob copi.
>