用什么方法来动态改变标签<html:form action="">的action的值,让它传递参数

解决方案 »

  1.   

    <%
       String url="loginAction.do";
       request.setAttribute("url",url);
    %>
    <html:form action="${url}">
       <!--参数-->
       <html:hidden property="username" value="admin"/>
    </html:form>
      

  2.   

    <%
    String url = "***.do?parms="+parm;
    .....
    .....
    %><html:form action="<%=url%>">其实用html:hidden的方式传递参数去后台更好更安全
      

  3.   

    <html:form action="<%=url%>">应该没有问题的
      

  4.   

    不好用呀,在查看源代码是原封不动的输出,如action="/xaoer/userLogin.do?uid=${parameter}",怎么回事呢,我是刚学这个的,请大家不惜赐教
      

  5.   

    不要用表达式,可能你的服务器不支持,用<%=url%>比较好,你定义一个URL=你要的连接加参数的字符串就可以了!
      

  6.   

    我去试了,还是不可以同样在地址栏里显示<%=parameter%>,并不显示参数的值,昨天我就开始做,到现在还是不可以,快帮帮我吧,我快要被老板骂了
      

  7.   

    使用支持JSP的应用服务器了吗?
      

  8.   

    用的是tomcat5.5,大家快帮帮我吧
      

  9.   

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> 
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>留言本 - 首页</title>
    <link href="/xaoer/xaoer/dowebsite/guestbook/style/style.css" rel="stylesheet" type="text/css" /></head>
    <% 
        String parameter="";
        parameter=(String)request.getParameter("uid");
        //System.out.println("request.getParameter="+parameter);
        //用来标识哪个留言本,从来访者的URL得到
    String from=request.getHeader("referer");
    //System.out.println(from);
    if(parameter==null || parameter.equals("")){
    if(from!=null && !from.equals("")){
    int i=from.lastIndexOf("uid=");
    if(i>-1){
    parameter=from.substring(i+4,from.length());
    //System.out.println("从来访者那得到top.jsp页面得到的uid="+parameter);
    }
    }
    parameter=(String)request.getAttribute("owner");
    //System.out.println("从request那得到top.jsp页面得到的uid="+parameter);
    }
    //else
    //System.out.println("从传来的参数那得到top.jsp页面得到的uid="+parameter);

        
    %>
    <body><div id="top">
    </div><div id="form">
    <html:form action="/userLogin.do?uid=<%=parameter%>">
    代码是这样的,请大家帮忙分析一下,谢谢了
      

  10.   

    是不是struts标签里根本就不让写java脚本呀
      

  11.   

    function simplequery(){
     // alert(document.proListActionForm.action);
      document.proListActionForm.action="/pms/proListQueryAction.do?op=query";
     //  alert(document.proListActionForm.action);
      document.proListActionForm.submit();
    }
    这个就是我用的JS
      

  12.   

    这样好使了,谢谢你呀  ymjkk(楷楷),给分!!!