你发贴也发错了 不过我是从java版过来的 多给点分是才硬道理!!

解决方案 »

  1.   

    用双引号括住当然是这样啦
    <html:form action=<%out.print(saction);%>>
    或者
    <html:form action=<%out.print("\""+saction+"\"");%>>
    这样应该可以
      

  2.   

    我刚才试了一下怎么解析出来是对的,action是等于saction的值啊!
    我的是这样的
    <%
     String a = "/net/createBill";
    %>
    <html:form action="<%=a%>" styleId="createIncomeBill" method="post" >不知道你的是怎么样的
      

  3.   

    请问,你为什么要这么写呢?
    这种写法不是有违标签的初衷吗?另外如何解析的问题,完全是写这个标签的人和jsp规范决定的。以我来说,我建议你不要这么用。
      

  4.   

    <html:form action="<%=saction%>">这句话当然先解析java脚本,它会把变量saction的值付给form标签的的action属性,看某一标签属性是否支持动态求值,那么看看它相应的.tld文件,
    <name>form</name>
    <tagclass>org.apache.struts.taglib.html.FormTag</tagclass>
    <bodycontent>JSP</bodycontent>
    <attribute>
    <name>action</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    上面<required>true</required>说明该<html:form/>标签该属性是必须的,<rtexprvalue>true</rtexprvalue>说明该属性可以运行时动态求值,可以<%=...%>
      

  5.   

    同意:
     hellundertaker(向南奔跑的风) (
    用双引号括住当然是这样啦
    <html:form action=<%out.print(saction);%>>
    或者
    <html:form action=<%out.print("\""+saction+"\"");%>>
    这样应该可以
      

  6.   

    问题是值.但是你要合struts的宗旨.用什么JSP标签呢直接用struts标签不就可以了。<html:form action="/你要请求的action">一句话多简单
      

  7.   

    同意:
     hellundertaker(向南奔跑的风) (
    用双引号括住当然是这样啦
    <html:form action=<%out.print(saction);%>>
    或者
    <html:form action=<%out.print("\""+saction+"\"");%>>
    这样应该可以-------------------------------------
    www.sooyle.com 中文搜索新秀 网络收藏夹
      

  8.   

    <html:form action=<%out.print(saction);%>>
      

  9.   

    1、先由ActionServlet和对应Struts XXTag类把Struts标签解析成标准的html和JSP标签。
    2、在Struts标签中,有部分标签可采用<% %>方式赋值,因为它直接保留原样输出给JSP服务器,再由JSP服务器进一步解析。
    3、对于<html:form>,就不能用<% %>方式给action赋值,因为<html:form>在Struts解析时需要写上提取Bean名,这时由于还没到JSP服务器解析<% %>,所以用<% %>后<html:form>就取不到Bean名了,就会出错。同样,这里也不能用<html:write>来赋值。
    4、如果改用<form>就可以用<% %>、<html:write>方式给action赋值了,因为这时Struts不用自己去找Bean名。
    4、<html:form>解析方法如下(Struts源程序):
     public int doStartTag() throws JspException {        // Look up the form bean name, scope, and type if necessary
            this.lookup();        // Create an appropriate "form" element based on our parameters
            StringBuffer results = new StringBuffer();
            
            results.append(this.renderFormStartElement());        results.append(this.renderToken());        ResponseUtils.write(pageContext, results.toString());        // Store this tag itself as a page attribute
            pageContext.setAttribute(Constants.FORM_KEY, this, PageContext.REQUEST_SCOPE);        this.initFormBean();        return (EVAL_BODY_INCLUDE);    }    /**
         * Locate or create the bean associated with our form.
         * @throws JspException
         * @since Struts 1.1
         */
        protected void initFormBean() throws JspException {
            int scope = PageContext.SESSION_SCOPE;
            if ("request".equalsIgnoreCase(beanScope)) {
                scope = PageContext.REQUEST_SCOPE;
            }
            
            Object bean = pageContext.getAttribute(beanName, scope);
            if (bean == null) {
                if (type != null) {
                    // Backwards compatibility - use explicitly specified values
                    try {
                        bean = RequestUtils.applicationInstance(beanType);
                        if (bean != null) {
                            ((ActionForm) bean).setServlet(servlet);
                        }
                    } catch (Exception e) {
                        throw new JspException(
                            messages.getMessage("formTag.create", type, e.toString()));
                    }
                } else {
                    // New and improved - use the values from the action mapping
                    bean =
                        RequestUtils.createActionForm(
                            (HttpServletRequest) pageContext.getRequest(),
                            mapping,
                            moduleConfig,
                            servlet);
                }
                if (bean instanceof ActionForm) {
                    ((ActionForm) bean).reset(mapping, (HttpServletRequest) pageContext.getRequest());
                }
                if (bean == null) {
                    throw new JspException(messages.getMessage("formTag.create", beanType));
                }
                pageContext.setAttribute(beanName, bean, scope);
            }
            pageContext.setAttribute(Constants.BEAN_KEY, bean, PageContext.REQUEST_SCOPE);
        }