我做一个程序,想从浏览器直接打开servelet的action文件,但是我不会直接打开,所以就做了个jsp文件点击按钮转到.action,其实这个jsp文件一点用都没有。我想问下有没有什么办法,直接打开action文件,或者不做按钮,直接从jsp跳到。action

解决方案 »

  1.   

    你直接在地址栏上打action不就得了吗
      

  2.   

    直接配servlet映射,就可以用啊
      

  3.   

    对呀 配置web.xml文件 里的 servlet 映像表
      

  4.   

    <%@ page language="java" pageEncoding="gbk"%>
    <%@ taglib uri="/struts-tags" prefix="s" %>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>欢迎访问网站</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <meta http-equiv="refresh" content="1;url=befindex.action">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
      </head>
      
      <body>
       正在进入,请稍候......
      </body>
    </html>