jsp页面换行问题
我在struts的action中写了StringfileName=request.getParameter("fileName");StringBufferbuffer=...
我在struts的action中写了
String fileName=request.getParameter("fileName");
StringBuffer buffer=new StringBuffer();
String s=null;
BufferedReader in=null;
try {
File file=new File(fileName);
in=new BufferedReader(new FileReader(file));
while((s=in.readLine())!=null)
{
buffer.append(s+"\r\n");
}
request.setAttribute("message", buffer);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally
{
try {
in.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return mapping.findForward("turn");
}
为什么到jsp中输出的内容不换行呢 展开
String fileName=request.getParameter("fileName");
StringBuffer buffer=new StringBuffer();
String s=null;
BufferedReader in=null;
try {
File file=new File(fileName);
in=new BufferedReader(new FileReader(file));
while((s=in.readLine())!=null)
{
buffer.append(s+"\r\n");
}
request.setAttribute("message", buffer);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally
{
try {
in.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return mapping.findForward("turn");
}
为什么到jsp中输出的内容不换行呢 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询