我正在创建一个涉及大量数据库访问以及解析和分析数据的Web应用程序,Java是我最熟悉的语言,但最近有人告诉我应该考虑使用PHP,因为它使数据库访问协议变得更加简单.
我没有任何关于PHP的知识,但是如果它是功能性,可移植性等方面它将是更好的选择,它将愿意学习使用.
Web应用程序将针对Oracle数据库运行并使用Flex作为GUI,请注意类似项目的任何经验以及使您选择的方法更好的原因将有助于或仅仅是任何形式的意见.
我已经创建了一个使用m2 eclipse工具的项目并且现在选择了web应用程序原型如果我尝试打包这个空的应用程序我得到一个构建失败说
[ERROR] Plugin org.apache.maven.plugins:maven-war-plugin:2.1 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-war-plugin:jar:2.1 in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update in
terval of central has elapsed or updates are forced -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-war-plugin:2.1 or one of its dependencies could not be resolv
ed: Failure to find org.apache.maven.plugins:maven-war-plugin:jar:2.1 in http://repo1.maven.org/maven2 was cached in the local repository, resolution
will not be reattempted until the update …
Run Code Online (Sandbox Code Playgroud) 我有一个简单的Jersey jax rs hello world应用程序,我正在尝试部署到我的tomcat服务器,所以我可以调用资源url并检查它是否给了我所需的输出,但是当我在web.xml中设置上下文路径时它没有部署到它所做的服务器,但是当我把servlet信息拿出来并留下一个空白的web.xml意味着这一定是我的问题.这是我的web.xml的内容.
`<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Web App</display-name>
<servlet-name>ServletContainer</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletContainer</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>
</web-app>
Run Code Online (Sandbox Code Playgroud)
这里要求的是错误的堆栈跟踪
[INFO] [war:war {execution: default-war}]
[INFO] Packaging webapp
[INFO] Assembling webapp[app1] in [C:\Users\leo\4thYearUni\Project\app1\target\app1]
[INFO] Processing war project
[INFO] Copying webapp resources[C:\Users\leo\4thYearUni\Project\app1\src\main\webapp]
[INFO] Webapp assembled in[170 msecs]
[INFO] Building war: C:\Users\leo\4thYearUni\Project\app1\target\app1.war
[INFO] [tomcat:redeploy {execution: default-cli}]
[INFO] Deploying war to http://localhost:8080/app1
[INFO] OK - Undeployed application at context path /app1
[INFO] FAIL - Failed to …
Run Code Online (Sandbox Code Playgroud) 基于我正在创建的弹簧网络应用程序的快速问题.
你如何设置应用程序的上下文,这样你就不需要一直为simpleJDBC设置数据源参数,并且可以调用getSimpleJDBCTemplate().queryfor ....并使用数据源进行设置.
这就是我现在拥有它的方式,它似乎反对控制的反转,春天意味着提供,因为这是每个dao!
ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("classpath:ApplicationContext.xml");
DataSource dataSource = (DataSource) ac.getBean("dataSource");
SimpleJdbcTemplate simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
Run Code Online (Sandbox Code Playgroud)
的ApplicationContext
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:properties.properties"/>
</bean>
<bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${username}"/>
<property name="password" value="${password}"/>
</bean>
<bean name="SimpleJdbcTemplate" class="org.springframework.jdbc.core.simple.SimpleJdbcTemplate">
<constructor-arg><ref bean="dataSource"/></constructor-arg>
</bean>
<context:annotation-config/>
</beans>
Run Code Online (Sandbox Code Playgroud)
来自Tomcat日志的最新堆栈跟踪
13-Jan-2011 20:15:18 com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
ptc.jersey.spring
13-Jan-2011 20:15:18 …
Run Code Online (Sandbox Code Playgroud) 我正在开发一个flex java - spring web应用程序,并使用hibernate设置了业务逻辑.
我想维护会话,以便在用户登录时,我可以跟踪登录用户以显示与用户名相关的信息.
我想尽可能使用spring来做这件事,并想知道是否有人可以将我重定向到教程,甚至解释实现这一目标的方法,或者是否很难实现.
谢谢克里斯