<commit_before>package com.alibaba.rocketmq.action;

import java.util.Collection;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.cli.Option;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.alibaba.rocketmq.common.Table;
import com.alibaba.rocketmq.service.MessageService;


/**
 * 
 * @author <EMAIL>
 * @date 2014-2-17
 */
@Controller
@RequestMapping("/message")
public class MessageAction extends AbstractAction {

    @Autowired
    MessageService messageService;


    protected String getFlag() {
        return "message_flag";
    }


    @RequestMapping(value = "/queryMsgById.do", method = { RequestMethod.GET, RequestMethod.POST })
    public String queryMsgById(ModelMap map, HttpServletRequest request,
            @RequestParam(required = false) String msgId) {
        Collection<Option> options = messageService.getOptionsForQueryMsgById();
        try {
            if (request.getMethod().equals(GET)) {

            }
            else if (request.getMethod().equals(POST)) {
                checkOptions(options);
                Table table = messageService.queryMsgById(msgId);
                putTable(map, table);
            }
            else {
                throwUnknowRequestMethodException(request);<commit_msg>fix bug:console can not open message query by id,because there miss a method to build the template.<commit_after>package com.alibaba.rocketmq.action;

import java.util.Collection;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.cli.Option;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.alibaba.rocketmq.common.Table;
import com.alibaba.rocketmq.service.MessageService;


/**
 * 
 * @author <EMAIL>
 * @date 2014-2-17
 */
@Controller
@RequestMapping("/message")
public class MessageAction extends AbstractAction {

    @Autowired
    MessageService messageService;


    protected String getFlag() {
        return "message_flag";
    }


    @RequestMapping(value = "/queryMsgById.do", method = { RequestMethod.GET, RequestMethod.POST })
    public String queryMsgById(ModelMap map, HttpServletRequest request,
            @RequestParam(required = false) String msgId) {
        Collection<Option> options = messageService.getOptionsForQueryMsgById();
        putPublicAttribute(map, "queryMsgById", options, request);
        try {
            if (request.getMethod().equals(GET)) {

            }
            else if (request.getMethod().equals(POST)) {
                checkOptions(options);
                Table table = messageService.queryMsgById(msgId);
                putTable(map, table);
            }
            else {
                throwUnknowRequestMethodException(request);
{'fraction_non_alphanumeric': 0.1005773321178973, 'fraction_numerical': 0.00425402613187481, 'mean_word_length': 3.4128686327077746, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1222081', 'n_tokens_mistral': 886, 'n_tokens_neox': 855, 'n_words': 169}