You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "kuma.cra" <ku...@ntlworld.com> on 2001/06/05 00:27:55 UTC

Re: Newbie to struts - jdbc/dbtags


Hi,  im a newbie to struts basically applying the examples and reading
the documentation (mvc). I am about to connect a psql datasource
(Postgresql, luinx OS) database to a struts mvc utilizing a database URL
.

Thus is there a ActionForm example and what level if i have to create a
ActionForm class i.e /WEB-INF/classes/custom/ActionForm or can i create
a package above WEB-INF as at the moment i am creating/modifying
examples from the taglib's and packaging them under mt Struts-bbnpa (my
re-named struts app's.

Re:dbtags problem within my struts web application!!

Posted by Chuck Amadi <ch...@breconbeacons.org>.
Hi Ted and fellow Struts Users's , I have got  a package named stock beneath
C:\jakarat-tomcat-3.2.1\webapps.
Thus there is a \WEB-INF that holds a classes dir and a lib dir and dbtags.xml
and web.xml. In the lib directory resides dbtags.jar and jdbc7.0-1.2.jar

I have declared taglib uri  directive at top of page testDB.jsp and added a
<taglib> element to my web application deploy descriptor  in /WEB-INF/web.xml
- as below

<web-app>
  <description>
  Example web application illustrating the use of tags in the
  DBTags custom tag library, from the JAKARTA-TAGLIBS project.
  </description>
  <taglib>
    <taglib-uri>http://jakarta.apache.org/taglibs/dbtags</taglib-uri>
    <taglib-location>/WEB-INF/dbtags.tld</taglib-location>
  </taglib>
  <security-role>
    <role-name>admin</role-name>
  </security-role>
</web-app>

Thus there is a dbtags .xml wish i believe is required for mapping all custom
action names to the corresponding  tag handler classes ( not nothing in the
classes file ). Nevertheless this works perfectly when i run
http://localhost:8080/stock/testDB.jsp.
albeit i have recreated the same steps i placed the stock package into by
struts-bbnpa (web app ) under classes were i have two other packages that i
created via tutorials and again the config tld,jar and xml mapping ,and run
http://localhost:8080/struts-bbnpa/testDB.jsp. This doesn't seem to work my
error is-

Not Found (404)

Original request: /struts-bbnpa/testDB.jsp

Not found request: /struts-bbnpa/testDB.jsp

Any suggestions as i have created a prototype Postgresql db with data and i am
trying to connect to my company proto web site the first works though.
Sorry if long winded. Cheers chuck.

>
>
>

--
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: Newbie to struts - jdbc/dbtags

Posted by "kuma.cra" <ku...@ntlworld.com>.
Hi Ted , it did thanks.

Ted Husted wrote:
> 
> You can configure Postgresql in the struts-config.xml, and then use the
> same datasource with the Jakarta Taglibs JDBC. Works like a charm.
> 
> Struts uses "org.apache.struts.action.DATA_SOURCE" as the datasource
> identifier (see Action.java).
> 
> "kuma.cra" wrote:
> >
> > Hi,  im a newbie to struts basically applying the examples and reading
> > the documentation (mvc). I am about to connect a psql datasource
> > (Postgresql, luinx OS) database to a struts mvc utilizing a database URL
> > .
> >
> > Thus is there a ActionForm example and what level if i have to create a
> > ActionForm class i.e /WEB-INF/classes/custom/ActionForm or can i create
> > a package above WEB-INF as at the moment i am creating/modifying
> > examples from the taglib's and packaging them under mt Struts-bbnpa (my
> > re-named struts app's.
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/

Re: Newbie to struts - jdbc/dbtags

Posted by Ted Husted <hu...@apache.org>.
You can configure Postgresql in the struts-config.xml, and then use the
same datasource with the Jakarta Taglibs JDBC. Works like a charm. 

Struts uses "org.apache.struts.action.DATA_SOURCE" as the datasource
identifier (see Action.java).

"kuma.cra" wrote:
> 
> Hi,  im a newbie to struts basically applying the examples and reading
> the documentation (mvc). I am about to connect a psql datasource
> (Postgresql, luinx OS) database to a struts mvc utilizing a database URL
> .
> 
> Thus is there a ActionForm example and what level if i have to create a
> ActionForm class i.e /WEB-INF/classes/custom/ActionForm or can i create
> a package above WEB-INF as at the moment i am creating/modifying
> examples from the taglib's and packaging them under mt Struts-bbnpa (my
> re-named struts app's.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/