String xgsj=request.getParameter("xgsj");得不到值为什么?
解决方案 »
- xml 文件中的 替换问题
- jsp页面错误,错误信息是“语法错误”...但编译通过.....
- 连接数据库出现的问题,清高手赐教!多谢!
- 【太着急了!!110分!!两个帖子一块给分】找了一个jsp程序的源代码,谁能帮我在线调试一下,110分
- 有谁知道XMLHTTP使用POST方法发送内容时接收到乱码的问题?
- 为什么在Ecplise中调用jsp不能正常显示,而把文件放到tomcat下单独执行却可以?
- struts2+jasperreport处理大量数据问题
- SERVLET这个单词应该什么读啊
- java如何获取访问者的域名?
- 菜问:web-inf\jsp\beabs\opendb\目录在哪里啊?我怎么找不到呢???????????
- 关于数据库操作的异常???有点奇怪,从来没有碰到过!!!
- tomcat5安装时候的问题
private String[] fileName; final public void init(ServletConfig config) throws ServletException {
this.config = config;
}
final public ServletConfig getServletConfig() {
return config;
}
SmartUpload mySmartUpload=new SmartUpload();
// Initialization
mySmartUpload.initialize(config,request,response);
String operation=mySmartUpload.getRequest().getParameter("operation").trim();
m_formRequest:
int m_totalBytes = m_request.getContentLength();
Byte[] m_binArray = new byte[m_totalBytes];
int j;
for(; i < m_totalBytes; i += j)
try
{
m_request.getInputStream();
j = m_request.getInputStream().read(m_binArray, i, m_totalBytes - i);
}
catch(Exception exception)
{
} for(; !flag1 && m_currentIndex < m_totalBytes; m_currentIndex++)
if(m_binArray[m_currentIndex] == 13)
flag1 = true;
else
m_boundary = m_boundary + (char)m_binArray[m_currentIndex]; if(m_currentIndex == 1)
return;
for(m_currentIndex++; m_currentIndex < m_totalBytes; m_currentIndex = m_currentIndex + 2)
{
String s1 = getDataHeader();
m_currentIndex = m_currentIndex + 2;
boolean flag3 = s1.indexOf("filename") > 0;
String s3 = getDataFieldValue(s1, "name");
getDataSection();
String s11 = new String(m_binArray, m_startData, (m_endData - m_startData) + 1);
putParameter(s3, s11);
if((char)m_binArray[m_currentIndex + 1] == '-')
break;
}private void getDataSection()
{
boolean flag = false;
String s = new String();
int i = m_currentIndex;
int j = 0;
int k = m_boundary.length();
m_startData = m_currentIndex;
m_endData = 0;
while(i < m_totalBytes)
if(m_binArray[i] == (byte)m_boundary.charAt(j))
{
if(j == k - 1)
{
m_endData = ((i - k) + 1) - 3;
break;
}
i++;
j++;
} else
{
i++;
j = 0;
}
m_currentIndex = m_endData + k + 3;
}
protected void putParameter(String s, String s1)
{
Hashtable m_parameters = new Hashtable();
int m_counter = 0;
if(s == null)
throw new IllegalArgumentException("The name of an element cannot be null.");
if(m_parameters.containsKey(s))
{
Hashtable hashtable = (Hashtable)m_parameters.get(s);
hashtable.put(new Integer(hashtable.size()), s1);
} else
{
Hashtable hashtable1 = new Hashtable();
hashtable1.put(new Integer(0), s1);
m_parameters.put(s, hashtable1);
m_counter++;
}
}
mySmartUpload.initialize(pageContext);
// Upload
mySmartUpload.upload();String path = mySmartUpload.getRequest().getParameter("PATH")
private ServletConfig config;
private ServletResponse response;
PageContext pageContext;
ServletRequest request;
这样定义对话.
private ServletConfig config;
private ServletResponse response;
PageContext pageContext;
ServletRequest request;
这样定义对话为什么不对啊?
mySmartUpload.initialize(pageContext);servlet中用
SmartUpload.initialize(config,request,response);