I am getting a 404 not found Error in Spring Application -


i not able navigate next page search can please tell me doing wrong here.i getting 404 not found error.

i trying assemble code found in https://github.com/christophstrobl/spring-data-solr-showcase

searchcontroller.java

/*  * copyright 2012 - 2013 original author or authors.  *  * licensed under apache license, version 2.0 (the "license");  * may not use file except in compliance license.  * may obtain copy of license @  *  * http://www.apache.org/licenses/license-2.0  *  * unless required applicable law or agreed in writing, software  * distributed under license distributed on "as is" basis,  * without warranties or conditions of kind, either express or implied.  * see license specific language governing permissions ,  * limitations under license.  */ package org.springframework.data.solr.showcase.product.web;  import java.util.collections; import java.util.linkedhashset; import java.util.set;  import javax.servlet.http.httpservletrequest; import javax.ws.rs.path;  import org.springframework.beans.factory.annotation.autowired; import org.springframework.context.annotation.scope; import org.springframework.data.domain.page; import org.springframework.data.domain.pageable; import org.springframework.data.solr.core.query.result.facetfieldentry; import org.springframework.data.solr.core.query.result.facetpage; import org.springframework.data.solr.showcase.product.productservice; import org.springframework.data.solr.showcase.product.model.product; import org.springframework.data.web.pageabledefault; import org.springframework.stereotype.component; import org.springframework.stereotype.controller; import org.springframework.ui.model; import org.springframework.util.stringutils; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.requestparam; import org.springframework.web.bind.annotation.responsebody;   @path("/") @controller @component @scope("prototype") public class searchcontroller {      private productservice productservice;      @requestmapping("/search")     public string search(model model, @requestparam(value = "q", required = false) string query, @pageabledefault(             page = 0, size = productservice.default_page_size) pageable pageable, httpservletrequest request) {          model.addattribute("page", productservice.findbyname(query, pageable));         model.addattribute("pageable", pageable);         model.addattribute("query", query);         return "search";     }      @responsebody     @requestmapping(value = "/autocomplete", produces = "application/json")     public set<string> autocomplete(model model, @requestparam("term") string query,             @pageabledefault(page = 0, size = 1) pageable pageable) {         if (!stringutils.hastext(query)) {             return collections.emptyset();         }          facetpage<product> result = productservice.autocompletenamefragment(query, pageable);          set<string> titles = new linkedhashset<string>();         (page<facetfieldentry> page : result.getfacetresultpages()) {             (facetfieldentry entry : page) {                 if (entry.getvalue().contains(query)) { // have not use terms vector or string field                     titles.add(entry.getvalue());                 }             }         }         return titles;     }      @autowired     public void setproductservice(productservice productservice) {         this.productservice = productservice;     }  } 

web.xml

<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0">   <display-name>testing2</display-name>   <welcome-file-list>     <welcome-file>index.html</welcome-file>     <welcome-file>index.htm</welcome-file>     <welcome-file>index.jsp</welcome-file>     <welcome-file>default.html</welcome-file>     <welcome-file>default.htm</welcome-file>     <welcome-file>default.jsp</welcome-file>   </welcome-file-list>    <context-param>         <param-name>contextconfiglocation</param-name>         <param-value>classpath:applicationcontext.xml</param-value>     </context-param>    <listener>     <listener-class>org.springframework.web.context.contextloaderlistener</listener-class>  </listener>   <!-- applies log4j configuration -->     <listener>        <listener-class>org.springframework.web.util.log4jconfiglistener</listener-class>     </listener>       <servlet>         <servlet-name>jersey-serlvet</servlet-name>         <servlet-class>com.sun.jersey.spi.spring.container.servlet.springservlet</servlet-class>         <init-param>             <param-name>com.sun.jersey.config.property.packages</param-name>             <param-value>org.springframework.data.solr.showcase.product.web</param-value>         </init-param>         <load-on-startup>1</load-on-startup>     </servlet>      <servlet-mapping>         <servlet-name>jersey-serlvet</servlet-name>         <url-pattern>/</url-pattern>     </servlet-mapping>  </web-app> 

index.jsp

<%@ page language="java" contenttype="text/html; charset=utf-8" pageencoding="utf-8" trimdirectivewhitespaces="true"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ page session="false"%> <html> <head>     <title>spring-data-solr-showcase</title>     <link href="<c:url value="/resources/css/styles.css" />" rel="stylesheet"  type="text/css" />     <script type="text/javascript" src="<c:url value="/resources/jquery/jquery-1.8.2.js" />"></script> </head> <body>     welcome.<br />     search sample &gt; <a href="./search">goto</a> </body> 

my applicationcontext.xml

<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-3.0.xsd      http://www.springframework.org/schema/context     http://www.springframework.org/schema/context/spring-context-3.0.xsd">     <context:component-scan base-package="org.springframework.data.solr.showcase" /> </beans> 


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -