本文介绍了覆盖struts2中的css_xhtml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的jsp代码在这里我使用struts2我的问题是如何重写struts2与css_xhtml,我非常新的struts2 plz帮助我出thk u

 <%@ page language =javacontentType =text / html; charset = ISO-8859-1
pageEncoding =ISO-8859-1 %>
<%@ taglib uri =/ struts-tagsprefix =s%>
<!DOCTYPE html PUBLIC - // W3C // DTD HTML 4.01 Transitional // ENhttp://www.w3.org/TR/html4/loose.dtd\">
< html>
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = ISO-8859-1>
< title>在此插入标题< / title>
< / head>
< body>
< h1>注册< / h1>
< s:form action =registermethod =posttheme =css_xhtml>
< s:textfield key =bean.uname>< / s:textfield>
< s:textfield key =bean.email>< / s:textfield>
< s:textfield key =bean.mobile>< / s:textfield>
< s:password key =bean.pwd>< / s:password>
< s:password key =bean.rpwd>< / s:password>
< s:submit value =submitalign =center>< / s:submit>
< s:actionerror />
< / s:form>
< / body>
< / html>


解决方案

我看到有人尝试了很多来解释你,你根本不会得到。无论如何,让我也尝试一次:


  1. 使用简单主题 -



  2. 我已经写了一个CSS布局的示例表单来帮助你。
    $ b



     < style& 
    .username {
    border:1px solid;
    }
    .email {
    padding:10px;
    }
    < / style>


    This is my jsp code here i am using struts2 my question is to how to override the struts2 with the css_xhtml, i am very new to the struts2 plz help me out thk u

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@taglib uri="/struts-tags" prefix="s" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <h1>Register</h1>
    <s:form action="register" method="post" theme="css_xhtml">
    <s:textfield key="bean.uname"></s:textfield>
    <s:textfield key="bean.email"></s:textfield>
    <s:textfield key="bean.mobile"></s:textfield>
    <s:password key="bean.pwd"></s:password>
    <s:password key="bean.rpwd"></s:password>
    <s:submit value="submit" align="center"></s:submit>
    <s:actionerror/>
    </s:form>
    </body>
    </html>
    
    解决方案

    I see people tried a lot to explain you, but you simply don't get. Anyways, let me also try once :

    1. Use "simple" theme - this way you can write most of your customization

    2. I've written a sample form with some CSS layouting to help you out.

    <style>
    .username{
       border:1px solid;
    }
    .email{
       padding:10px;
    }
    </style>
    

    这篇关于覆盖struts2中的css_xhtml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 18:22