Package demo

Source Code of demo.InternationalServlet

package demo;

import javax.servlet.http.*;
import com.trulytech.mantis.system.ActionServlet;
import com.trulytech.mantis.system.SQLParser;
import com.trulytech.mantis.system.Permission;
import com.trulytech.mantis.result.DBResult;

/**
*
* <p>
* Title: Mantis
* </p>
*
* <p>
* Description:国际化演示
* </p>
*
* <p>
* Copyright: Copyright (c) 2002
* </p>
*
* <p>
* Company:
* </p>
*
* @author Wang Xian
* @version 1.0
*/
public class InternationalServlet extends ActionServlet {

  protected int HasPermission(HttpServletRequest request,
      HttpServletResponse response, SQLParser Parser) throws Exception {
    return Permission.ALLOW;
  }

  // 增加值
  public String newValue(HttpServletRequest request,
      HttpServletResponse response, SQLParser Parser) throws Exception

  {

    HttpSession session = request.getSession();
    session.setAttribute(
        com.trulytech.mantis.system.Properties.Session_Language,
        "EN_US");
    Parser.SQLExecute("insert into msgvalue(value) values ('[_msg]')");
    DBResult Result = Parser.PageExecute("select value from msgvalue");
    request.setAttribute("Result", Result);

    return "internationallist.jsp";

  }

  // 返回结果
  public String back(HttpServletRequest request,
      HttpServletResponse response, SQLParser Parser) throws Exception

  {
    HttpSession session = request.getSession();
    session
        .removeAttribute(com.trulytech.mantis.system.Properties.Session_Language);

    return "/international.jsp";

  }

}
TOP

Related Classes of demo.InternationalServlet

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.