Newsgroup: it.comp.java
Titolo: Struts e data-sources

una volta dichiarato un data source nello struts-config.xml, come posso
utilizzare nel model tali parametri?
grazie


All'interno della servlet devi richiamare il datasource;
dataSource=getDataSource(request);
 connection=dataSource.getConnection();
 statement=connection.createStatement();
etc...
ciao
euterpex

Ho fatto come mi hai suggerito.
compilo il codice -> tutto ok
mando in esecuzione e ottengo la seguente eccezione
StandardContext[]: Servlet  threw load() exception:
javax.servlet.ServletException: Servlet.init() for servlet action threw
exception
javax.servlet.ServletException: Servlet.init() for servlet action threw
exception
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:96
3)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
 at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3420)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3608)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
21)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
 at
org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.
java:700)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
 at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:260)
 at org.apache.commons.digester.Rule.end(Rule.java:276)
 at org.apache.commons.digester.Digester.endElement(Digester.java:1064)
 at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1536)
 at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
 at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
 at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
 at org.apache.commons.digester.Digester.parse(Digester.java:1562)
 at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.j
ava:385)
 at org.apache.catalina.core.StandardHost.install(StandardHost.java:803)
 at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:442
)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:399)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718)
 at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:358)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:166)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
 at org.apache.catalina.core.StandardService.start(StandardService.java:497)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Grazie
kekko

 ha scritto nel messaggio
news:c1frcd$7oo$1...@lacerta.tiscalinet.it...
