user2767354
user2767354

Reputation: 99

overriding css_xhtml in struts2

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>

Upvotes: 0

Views: 1363

Answers (2)

coding_idiot
coding_idiot

Reputation: 13734

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.

<s:form action="register" method="post" theme="simple">
<table>
<tr>
<td><label>Username</label></td>
<td><s:textfield key="bean.uname" cssClass="username"></s:textfield></td>
</tr><tr>
<td><label>Email</label></td>
<td>
<s:textfield key="bean.email" cssClass="email"></s:textfield>
</td>
</tr>
<tr>
<td colspan="2">
<s:submit/>
</td>
</tr>
</table>
</s:form>
<style>
.username{
   border:1px solid;
}
.email{
   padding:10px;
}
</style>

Upvotes: 1

Renjith
Renjith

Reputation: 216

try <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

instead of <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>

Upvotes: 1

Related Questions