<%!
String str = "prerna";
%>
<jsp:include page="index.html">
<jsp:param name="type1" value=<%=str%> >
</jsp:param>
</jsp:include>
Run Code Online (Sandbox Code Playgroud)
我想在param标签中传递一个java变量,但我不知道该怎么做.
我也想访问它index.html.
任何人都可以建议我这样做吗?
<%
out.print("<textarea name='test' id='test'value='"+uabout+"'></textarea>");
%>
Run Code Online (Sandbox Code Playgroud)
不工作.有语法错误.
数据库中的日期值是2011-03-19 18:49:04
Timestamp date;
ResultSet rs=smt.executeQuery("select * from posttopic where name='"+logn+"'");
while(rs.next()){
name=rs.getString(1);
title=rs.getString(2);
subject=rs.getString(3);
message=rs.getString(4);
date=rs.getTimestamp(5);
System.out.print(date);
}
Run Code Online (Sandbox Code Playgroud)
上述函数返回的日期值是2011-03-19 18:49:04.0.
为什么它会在最后添加.0?如何删除它?
<table id="post">
<tr>
<td style="font-size: 20px;">Post Your comment</td>
</tr>
<tr>
<td>Name:</td>
<td><input type="text" id="username" name="username"></td>
</tr>
<tr><form id="postform" action="" method="post" name="form">
<td>Type your message here:</td>
<td><textarea name="text" id="text" rows="5" cols="40"></textarea></td>
<tr>
<td><input type="hidden" id="pageid" name="pageid" value="20"></td>
</tr>
<tr>
<td><input id="submit" type="submit" value="Post Comment" name="submit" style="width:auto;"/></td>
</tr>
</form>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
该页面在刷新后保留在文本框和文本区域中的值.任何人都建议我克服它的方法吗?