com.slience.controller.SolrController.java Source code

Java tutorial

Introduction

Here is the source code for com.slience.controller.SolrController.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.slience.controller;

//import com.zdy.solr.service.SolrSimpleQueryService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 *
 * @author zdy
 */
@Controller
public class SolrController {

    //@Autowired
    //SolrSimpleQueryService solrSimpleQueryService;

    @RequestMapping("/solr")
    @ResponseBody
    public void handSolrRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        request.setCharacterEncoding("UTF-8");
        response.setContentType("application/json;charset=UTF-8");

        //solrSimpleQueryService.service();

    }
}