action代码:
[java] view plain copy
private InputStream inputStream;
public InputStream getResult()
{
return inputStream;
}
public String checkusername()
{
try
{
inputStream = new ByteArrayInputStream("要返回的字符串".getBytes("UTF-8"));
}
catch (UnsupportedEncodingException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return "isExist";
}
struts.xml代码:
[html] view plain copy
text/html
result