मैंने एक नव निर्मित मेवेन वेबपैप प्रोजेक्ट उठाया, और इसके साथ एमवीसी एप्लीकेशन का सबसे सरल करना चाहता है। मेरी वातावरण लग रहा है तो जैसे:पूर्ण यूरी: http://java.sun.com/jsp/jstl/core को हल नहीं किया जा सकता
<context:component-scan base-package="com.personal.springtest.admin.webapp" />
<mvc:annotation-driven />
web.xml इतनी के रूप में के रूप में सरल:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<servlet>
<servlet-name>iwadminservlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/project-admin-webapp-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>iwadminservlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
मेरी नियंत्रक तो बस की तरह है:
<artifactId>spring-core</artifactId>
<artifactId>spring-test</artifactId>
<artifactId>spring-beans</artifactId>
<artifactId>spring-context</artifactId>
<artifactId>spring-aop</artifactId>
<artifactId>spring-context-support</artifactId>
<artifactId>spring-tx</artifactId>
<artifactId>spring-orm</artifactId>
<artifactId>spring-web</artifactId>
<artifactId>spring-webmvc</artifactId>
<artifactId>spring-asm</artifactId>
<artifactId>log4j</artifactId>
<artifactId>hibernate-core</artifactId>
<artifactId>hibernate-cglib-repack</artifactId>
<artifactId>hsqldb</artifactId>
<!-- particular arears-->
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- -->
<spring.version>3.0.5.RELEASE</spring.version>
<hibernate.version>3.6.1.Final</hibernate.version>
<hibernate-cglig-repack.version>2.1_3</hibernate-cglig-repack.version>
<log4j.version>1.2.14</log4j.version>
<javax-servlet-api.version>2.5</javax-servlet-api.version>
<hsqldb.version>1.8.0.10</hsqldb.version>
<mysql-connector.version>5.1.6</mysql-connector.version>
<slf4j-log4j12.version>1.5.2</slf4j-log4j12.version>
<slf4j-api.version>1.5.8</slf4j-api.version>
<javaassist.version>3.7.ga</javaassist.version>
<taglibs.version>1.1.2</taglibs.version>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-beta-1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
<finalName>admin-webapp</finalName>
</build>
<profiles>
<profile>
<id>endorsed</id>
<activation>
<property>
<name>sun.boot.class.path</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<!-- javaee6 contains upgrades of APIs contained within the JDK itself.
As such these need to be placed on the bootclasspath, rather than classpath of the
compiler.
If you don't make use of these new updated API, you can delete the profile.
On non-SUN jdk, you will need to create a similar profile for your jdk, with the similar property as sun.boot.class.path in Sun's JDK.-->
<compilerArguments>
<bootclasspath>${settings.localRepository}/javax/javaee-endorsed-api/6.0/javaee-endorsed-api-6.0.jar${path.separator}${sun.boot.class.path}</bootclasspath>
</compilerArguments>
</configuration>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server>
<tomcat.home>${env.CATALINA_HOME}</tomcat.home>
<web.context>${project.artifactId}</web.context>
</properties>
मेरी applicationContext के रूप में सरल है
@Controller
public class HomeController {
@RequestMapping(value="/")
public String Home(){
System.out.print("THIS IS a demo mvc, i think i like it");
// this is temporary, will use viewresolver when everything clears up
return "/views/home.jsp";
}
}
मेरा विचार है:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
त्रुटि मैं हो रही है
org.apache.jasper.JasperException है: पूर्ण uri: http://java.sun.com/jsp/jstl/core या तो web.xml या जार इस आवेदन
के साथ तैनात फाइलों में हल नहीं किया जा सकता है
प्रश्न 1: मैं सोच रहा हूँ अगर यह संस्करण मैं उपयोग कर रहा हूँ की वजह से है, मुझे लगता है कि मैं बिल्ला में समर्थित संस्करण के बारे में कुछ पढ़ा है, और जावा ईई संस्करण used.don't वास्तव में मिलता है इधर-उधर मैं अपनी समस्या को ठीक करने का एक तरीका है। मैं इसे कैसे ठीक करूं?
प्रश्न 2: http://localhot:8080/ जबकि: इस त्रुटि क्योंकि मैं सही ढंग से views/home.jsp
को यह इशारा करते हुए नहीं कर रहा था, लेकिन मैं था नोटिस कि जब मैं NetBeans में अनुप्रयोग चलाने के लिए, यह यूआरएल के साथ ब्राउज़र को खोलता है मैं कोड 400 हो रही थी इससे पहले कि मैं http://localhost:8080/admin-webapp/ व्यवस्थापक-वेबपैप को अपने युद्ध का नाम होने की उम्मीद कर रहा था। मुझे विश्वास है कि यह एक समस्या है और इसे संबोधित करना चाहते हैं।
टोमकैट वास्तव में जेएसटीएल के साथ नहीं भेजता है। हमारे जेएसटीएल विकी पेज पर और पढ़ें: http://stackoverflow.com/questions/tagged/jstl – BalusC
उत्तर के लिए धन्यवाद, प्रश्न 2 के बारे में कोई विचार। मुझे लगता है कि मुझे बहुत कुछ –