Strust2上传Xls文件 数据超过200条就找不到action

Strust2上传XLS文件的时候 文件中的数据超过200条就找不到action
我在本地限制了一下 但是到了服务器还是不找不到action

package com.actions;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.io.FileUtils;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.struts2.ServletActionContext;
import com.beans.TjbryyBean;
import com.opensymphony.xwork2.ActionContext;
import com.util.ConnUtil;

/**

  • 团体导入
  • @author Administrator
  • */
    public class SaveXlsFileAction {
    private File[] newsfile;
    private String gzdw;
    private String[] newsfileFileName;
    ResultSet rs = null;
    PreparedStatement pst = null;
    TjbryyBean tb = new TjbryyBean();

    public TjbryyBean getTb() {
    return this.tb;
    }

    public void setTb(TjbryyBean tb) {
    this.tb = tb;
    }

    public String tjttDr() {
    String path1 = "";
    HttpServletRequest request = ServletActionContext.getRequest();
    for (int i = 0; i < this.newsfile.length; i++) {
    File zl = this.newsfile[i];
    String realname = this.newsfileFileName[i];
    if ((zl != null) && (zl.exists()) && (zl.length() > 0L)) {
    SimpleDateFormat f = new SimpleDateFormat("yyyyMMddhhmmss");
    String time = f.format(Calendar.getInstance().getTime());
    String str = realname.substring(realname.lastIndexOf("."),
    realname.length());

            File destFile = new File(ServletActionContext
                    .getServletContext().getRealPath(
                            "\\upload\\" + this.gzdw + "\\" + time + str));
            path1 = path1 + "\\upload\\" + this.gzdw + "\\" + time + str;
            this.tb = new TjbryyBean();
            Workbook book = null;
            int totalRow = 0;
            String errorRows = "";
            Connection conn = new ConnUtil().getConn();
            String sql = "select harm_name from zy_harm";
            try {
                this.pst = conn.prepareStatement(sql);
                this.rs = this.pst.executeQuery();
                List<String> list = new ArrayList();
                while (this.rs.next()) {
                    list.add(this.rs.getString(1));
                }
                InputStream is = new FileInputStream(zl);
                book = WorkbookFactory.create(is);
                Sheet hssfSheet = book.getSheetAt(0);
                totalRow = hssfSheet.getLastRowNum();
                if(totalRow>200){
                    request.setAttribute("errors", "为了保证文件传输速度数据,数据量最大为200条!超过请分多次上传!");
                    return "success";
                }
                int num=0;
                for (int ii = 1; ii <= hssfSheet.getLastRowNum(); ii++) {
                    num=ii;
                    Row row = hssfSheet.getRow(ii);
                    if (row != null) {
                        if (row.getCell(5) != null) {
                            if ("职业".equals(row.getCell(5).getStringCellValue())) {
                                System.out.println(" 姓名"+row.getCell(0));
                                String jhyy = "";
                                if ((row.getCell(3) != null)&& (row.getCell(3).getCellType() == 1)) {
                                    jhyy = row.getCell(3).getStringCellValue();
                                    if (!checkJhyy(jhyy, list)) {
                                        errorRows = errorRows + (ii + 1)+ "、";
                                    }
                                }
                            }
                        }else{
                            request.setAttribute("zt", "表格中第 "+ii+"行 ,第5列未获取到数据!请检查!");
                        }
                    }
                }
                if (!"".equals(errorRows)) {
                    request.setAttribute("errors", "表格中第 " + errorRows
                            + " 行中的危害因素名称与数据库中不相符,无法保存表格。"
                            + "\\n请重新填写标准的危害因素名称!\\各危害因素之间请用中文输入法下的顿号隔开!");
                } else {
                    FileUtils.copyFile(zl, destFile);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    return "success";
    

    }

    public boolean checkJhyy(String jhyy, List list) {
    boolean flag = true;
    boolean temp = true;

    String[] jhyys = jhyy.split("、");
    for (int i = 0; i < jhyys.length; i++) {
        for (int j = 0; j < list.size(); j++) {
            if (jhyys[i].equals(list.get(j))) {
                temp = true;
                break;
            }
            temp = false;
        }
        if (!temp) {
            break;
        }
    }
    if (!temp) {
        flag = false;
    }
    return flag;
    

    }

    public File[] getNewsfile() {
    return this.newsfile;
    }

    public void setNewsfile(File[] newsfile) {
    this.newsfile = newsfile;
    }

    public String[] getNewsfileFileName() {
    return this.newsfileFileName;
    }

    public void setNewsfileFileName(String[] newsfileFileName) {
    this.newsfileFileName = newsfileFileName;
    }

    public String getGzdw() {
    return this.gzdw;
    }

    public void setGzdw(String gzdw) {
    this.gzdw = gzdw;
    }
    }

1个回答

把tomcat的超时设置和最大上传大小修改下。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
xls文件的上传和下载
xls文件上传:  .xml格式的文件,上传导入时不能用PIO来读取xml数据,只能用dom4j来解析。用PIO来导入会报一下异常: 异常一: Unable to read entire header; 0 bytes read; expected 512 bytes 解决办法:更新pio的包从3.5—final到3.15 异常二: org.apache.poi.poifs.f
strust2 action跳转问题
rnmain.html 界面代码rn[code=Java]rnrnrn rn xxxxx工作平台rnrnrnrn rn rn rnrn <body>rn</body>rnrn[/code]rnrncenter.html:rnrn[code=Java]rnrn rn xxxx工作平台rn rnrnrn rn rn rn rn rn rn rn rnrnrnrn[/code]rnrn我在left.html里,建个action跳转,我想跳转到right.html,可是怎么会跳到到left框框里?[img=http://hi.csdn.net/space-3745724-do-album-picid-916576.html][/img]rn
Strust2 action方法return
代码 rnrn [code=java]rnpublic String get()rn rn return null;rn rnrn[/code]rnrn在strust里面是这样的 就可以直接action名!get.action 调用。rnrnrn如果把null写成“” web页面 就返回404, rnrn 怎么会这样,先谢谢回帖人。。
Strust2上传与下载文件
struts2.2.1 上传与下载 ,对文件大小的设置,图片样式设置。文件下载。jar包自己添加
strust2 上传下载文件
strust2 上传下载文件. 这是最新代码技术。成功运行。
Strust2文件
开发需要的基本Strust2文件,里面有所需的jar包,欢迎下载
一次性上传100条数据提示超过最大线程
[img=https://img-bbs.csdn.net/upload/201802/28/1519806921_138088.jpg][/img]rnfor (i = 0; i < ds.Tables["Book1"].Rows.Count; i++)rnrn XXXXXXXXXXXrn DataAccessTool.DataAccessOracle.ExecuteSQL("DB", sql1);rnrn以前没遇到这种情况
access数据库一提交超过13条数据就出错,
access数据库一提交超过13条数据就出错,是不是access表中有什么限制?
STRUST2中ACTION跳转问题!!
RT.rn我想从一个ACTION中跳转到和这个ACTION不在同一个NAMESPACE的JSP页面中,求教怎么写。rn如ACTION的NAMESPACE为 /NAME1rnRESULT NAME 为"ss"rnJSP的位置/NAME2/A.JSPrn请问怎么写rn急~~~~~~~~~~~~谢谢
xls文件数据修改
修改文件操作步骤1.打开表格2.复制表格3.读取表格的页面4.修改表格的值5.保存# -*- coding: utf-8 -*- from xlrd import open_workbook from xlutils.copy import copy #打开一个表格 wb=open_workbook('b.xls') #复制一个表格 wbc=copy(wb) #获取到新表格里面的sheet页 ...
如何上传超过2M的文件?
我在php.ini中已经修改了一下几项rnmax_execution_time = 30rnmax_input_time = 60rnmemory_limit = 8Mrnupload_max_filesize=8Mrn但还是上传不了超过2M的文件rn而我的电脑上好像没有php.conf这个文件存在,修改不了里面的内容rn请问应该怎么解决??rnrn
strust2配置action的完整过程
后台action类 RoleManagerAction.java package com.ybcz.sys.sysaction; import com.ybcz.common.util.BaseAction; import com.ybcz.common.util.UserInfo; import com.ybcz.sys.role.service.SysRoleService; impo
Github上传超过100MB的文件
Github上传超过100MB的文件 摘要:本文介绍如何使用git上传超过100MB的单文件到github 作者:yooongchun 微信公众号:yooongchun小屋 0.问题说明 在使用github进行版本控制时,上传文件到github时发现超过100MB的文件无法上传 1.解决方案 使用Git LFS 上传。Git lFS(Git Large File St...
git上传超过100M的文件
git在上传超过100M大小的文件时会给出拒绝信息.经尝试,通过如下步骤解决.(注: 以下以在linux mint操作系统下,上传一个320M的distance.mat文件为例) 1. 首先到https://git-lfs.github.com/, 如下图,点击Download v2.3.4下载git-lfs     2. 下载的文件解压到任意目录下如:home 3. 点击上图Install...
怎么上传的文件找不到???
Form的enctype="multipart/form-data"rnrn上传后,写出Request.Files.Count,等于0rnrn看Request.ContentType=multipart/form-datarnrn怎么就是见不到文件呢???????rnrn哪们仁兄有完整的上传代码,借小弟展一眼
linux 上传的文件找不到
我用的php 上传文件 ,默认目录为 tmp ,其文件夹权限为777,可是我不论上传什么都找不到对应的文件,在临时文件夹里面压根没有,php。ini中的配置如下:[img=https://img-bbs.csdn.net/upload/201801/07/1515292087_254559.jpg][/img][img=https://img-bbs.csdn.net/upload/201801/07/1515292098_648676.jpg][/img][img=https://img-bbs.csdn.net/upload/201801/07/1515292109_765021.jpg][/img],请问这个问题怎么解决啊,谢谢[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/16.gif][/img][img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/8.gif][/img]
使用swfupload上传超过2个文件就报500
使用swfupload上传文件时,上传一个就正常,超过就报500。调试却很正常....
ASP上传文件大小超过1M就出错!!!
widnows2003下ASP上传文件大小超过1M就出错。我已经改过AspMaxRequestEntityAllowed了,当小于1M的时候,这个属性是起作用的,但是当大于1M时就不管用了。有遇到过同类情况的吗?请帮忙!
JDBC查询数据如何超过1000条数据
我数据库中存在10000条数据,如何一次性全部查出,JDBC每次最多能够查出1000条,怎样设置才可以一次性将10000条数据全部查出?
导出excel(超过65535条数据)例子
public HSSFWorkbook exportExcel(List list){         int count = list.size();         int num = count%50000;         int num1;         if(num==0){             num1=count/50000;         }else{
CFileDialog 如何读取超过200个文件
#define NAMEBUF 5010rnCFileDialog dlgFile( TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | rn OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_EXPLORER , rn _T("Image Files (*.bmp;*.jpg;*.gif;*.png;*.tif;*.jpeg) rn |*.bmp;*.jpg;*.gif;*.png;*.tif;*.jpeg||"), NULL); rnrndlgFile.m_ofn.lpstrFile=new TCHAR[NAMEBUF]; rnmemset(dlgFile.m_ofn.lpstrFile,0,NAMEBUF); rndlgFile.m_ofn.nMaxFile = NAMEBUF;rnrnif ( dlgFile.DoModal() == IDOK )rnrn POSITION pos = dlgFile.GetStartPosition();rn while ( pos != NULL )rn rn strFile = dlgFile.GetNextPathName( pos );rn rnrnrn这段代码可以读取几十个文件,但是当读取超过100个文件的时候就读取不了了,请各位大牛指点
strust2验证文件
strust2验证文件自动补全怎么做rn我在写strst2 验正文件的时候(比如:RegisterAction-validator.xml),想使用自动补全,应该添加一个什么样的dtd文件才能做到rn帮帮忙!?◎!rn谢了
action找不到
警告: Could not find action or resultrnThere is no Action mapped for action name list. - [unknown location]rn at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)rn at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)rn at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)rn at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)rnrnrn先访问http://localhost:8080/MIS/jsp/merch/list。然后就蹦出action找不到的信息了。。我的struts。xml文件中也已经配置了,放在src目录下了。请问是怎么回事啊rnrn
找不到Action
这是我的Struts配置文件rnrnrnrnrnrnrn rnrn rnrn rn rn /hello.jsprn rn rn rnrnrnrn下面是我的index.jsp文件rnrn<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>rn<%@ taglib uri="/struts-tags" prefix="s"%>rn<%rnString path = request.getContextPath();rnString basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";rn%>rnrnrnrn rn rn rn My JSP 'index.jsp' starting pagern rn rn rn rn rn rn rnrn rn rn rn This is my JSP page. rn rn rnrnrn在浏览器中输入http://localhost:8080/Struts2_001/index.jsp 这个地址就报错。rnrn错误如下:rnrn严重: Could not execute action: /hello1.actionrnThere is no Action mapped for action name hello1.action. - [unknown location]rn at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)rn at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)rn at org.apache.struts2.components.ActionComponent.executeAction(ActionComponent.java:249)rn at org.apache.struts2.components.ActionComponent.end(ActionComponent.java:155)rn at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)rn at org.apache.jsp.index_jsp._jspx_meth_s_005faction_005f0(index_jsp.java:117)rn at org.apache.jsp.index_jsp._jspService(index_jsp.java:89)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:595)rn请求解答那里错误!在下刚开始学着用Struts,还请高手回答。谢谢rnrnrnrn应该是这里出错了,就是不知道出在那里rnrn
怎么删除超过200条记录以后的记录??
一个表,里面存放记录,一旦记录超过200行.rn那么我就以时间为基准,把老的100行记录删除rn保留新的100行记录.
jspsmartupload上传后找不到文件
上传代码rnrn<%rn SmartUpload up=new SmartUpload();rn up.initialize(pageContext);rn up.upload();rn up.save("/SourceFile",File.SAVEAS_VIRTUAL);rn File f=up.getFiles().getFile(0);rn f.saveAs("/SourceFile/aa.txt",File.SAVEAS_VIRTUAL);rn out.println(up.getFiles().getFile(0).getFileName());rn out.println("添加成功");rn%>rnrn反正都提示添加成功,但是在sourcefile文件夹中什么都没有
在临时文件夹找不到上传的文件 Nodejs+multiparty
router.post('/',function(req, res, next)rn var form = new multiparty.Form();rn form.parse(req, function(err, fields, files)rn var img = files.photo_image;rn console.log(err);rn res.send(img[0].path);rn res.end();rn /*********************************************rn fs.rename(img[0].path, path, function(err)rn if (err) return next(err);rn res.redirect('/');rn );rn *****************************************/rn );rnrn网页输出了 路径的了rnC:\Users\ADMINI~1\AppData\Local\Temp\koyBKAwAqsJNkhEZMjwhVaZa.pngrn但是到该路径找不到这个文件 rn所以后面 rename也错误 提示找不到文件rn
ftp上传后找不到文件
Private Sub Command1_Click()rn Dim right1 As Booleanrn CommonDialog1.ShowOpenrn Inet1.URL = "ftp://219..."rn Inet1.Protocol = icFTPrn Inet1.RemoteHost = "219...."rnrn Inet1.UserName = "..."rn Inet1.Password = "..."rn MsgBox "准备上传"rn Inet1.Execute , "PUT " & CommonDialog1.FileName & " " & "/81/" & CommonDialog1.FileTitle rn right1 = Inet1.StillExecutingrn Do While right1rn right1 = Inet1.StillExecutingrn DoEventsrn Looprn MsgBox "成功"rnEnd Subrnrnrn代码如上,上传的文件到最后也弹出 成功了,但就是在web服务器中找不到这个文件。求解
为什么我找不到上传的文件???
upload.phprn rnrnSend this file: rnrnrnrnrn当我上传一个图片后显示rnFile is valid, and was successfully uploaded. Here's some more debugging info: Array ( [userfile] => Array ( [name] => b2.gif [type] => image/gif [tmp_name] => C:\PHP\uploadtemp\php2B.tmp [error] => 0 [size] => 902 ) ) rn但在我的上传文件加'C:/Inetpub/wwwroot/php/upload'中确没有。
Strust2学习之Action、Result知识要点
1.Action传递数据至JSP 发送:Action向前端传递数据的代码(共有四种方式,一般采用这一种): package com.bjsxt.struts2.user.action; import java.util.Map; import org.apache.struts2.interceptor.ApplicationAware; import org.apache.struts2
strust2问题:Could not find action or result
2012-3-22 17:08:08 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warnrn警告: Could not find action or resultrnThere is no Action mapped for action name hello. - [unknown location]rn at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)rn at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)rn at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)rn at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:500)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at java.lang.Thread.run(Unknown Source)
strust2的action的name的值和WebRoot下的包名问题
struts.xml的代码:rnrnrnrnrn rn rn rn rn rn /result.jsprn rn rnrnrnrnTest.java的代码:rnpackage com.view;rnrnimport com.opensymphony.xwork2.Action;rnimport com.opensymphony.xwork2.ActionSupport;rnrnpublic class Test extends ActionSupportrn public String test()rn return Action.SUCCESS;rn rnrnrnindex.jsp的代码:rn<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="ISO-8859-1"%>rnrnrnrn rn rn rn rn Testrn rnrnrnrnresult.jsp的代码:rn<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>rn<%rnString path = request.getContextPath();rnString basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";rn%>rnrnrnrn rn rn rn My JSP 'result.jsp' starting pagern rn rn rn rn rn rn rnrn rn rn rn 结果页面 rn rnrnrnrn在WebRoot下创建一个包,名字为aa,并在aa下创建manager.jsp.rn(运行环境MyEclipse6.5 + jds1.6)rnrn运行http://127.0.0.1:8080/test_struts2/ 后,点击Test出现错误提示如下:rnStacktracesrnThere is no Action mapped for namespace / and action name aa/. - [unknown location] rnrn测试后发现,如果action的name的值和在WebRoot下创建的包名一样的话,就会出现这个错误,rn不知道为什么。但是我又偏偏要用到action的name值和WebRoot下的某个包名一样,因为要拦截这个包。rnrn又什么办法解决吗?(前提要求action的name值和WebRoot下的某个包名一样)rnrn
怎么样修改前200条数据
我想把前200条数据同时修改成1,应该怎么做rnupdate aa set tt='1' where 这后面应该怎么写呢
strust2 怎么传递list传回action
通过s:iterator传了一个list到jsp,那么逆过程怎么写,就是让这个s:iterator中的信息传回list,新的list也行,原文如下。项目经理不让在JSP里写JAVA代码。rn[code=html]rnrn资源分数:rn"rnvalue=""/>rn[/code]
上传一个很大的文件,就老出现找不到dns的网页。
就是我在上传一个稍大点的文件,就会出现下面文中提到的问题。请问如何能解决这个问题?rn****************************************************************************************rn我们在上传大文件时都遇到过这样或那样的问题。设置很大的maxRequestLength值并不能完全解决问题,因为ASP.NET会block直到把整个文件载入内存后,再加以处理。实际上,如果文件很大的话,我们经常会见到Internet Explorer显示 "The page cannot be displayed - Cannot find server or DNS Error",好像是怎么也catch不了这个错误。rn**************************************************************************************rn
低年级 - 上传.xls
可心用来统计班级成绩,按学校,班级进行评比,用ABV制作的,参考了网上些代码,大家用用,学校成绩好用的
strust2
strust2 那么多版本 到底怎么配置啊rn谁有好点的视频是讲strust2的网站啊
Strust2从一个Action跳转到另一个Action的问题
假设现在要求写一个ACTIONrnsource.action?targetAction=xyzrn然后在这个action完成之后要跳转到未知的另一个action(如上面的xyz.action)rn现在我想要两种方法实现rn1.怎么在XML里面配置这个ACTION,因为targetAction这个参数是动态的rn2.怎么在程序里面RETURN 直接写了就跳转了。。。rn谢谢大家了,如果没有说明白,我再补充
strust2基于注解的action配置步骤
第一步:下载与struts2-core-2.3.34.jar版本相同的struts2-convention-plugin-2.3.34.jar放入lib文件下第二步:配置Strust.xml文件&amp;lt;!-- 请求参数的编码方式 --&amp;gt; &amp;lt;constant name=&quot;struts.i18n.encoding&quot; value=&quot;UTF-8&quot; /&amp;gt; &amp;lt;!-- 指定被struts...
django 上传xls表格,下载xls表格
from django.shortcuts import render,HttpResponse from django.views import View import xlrd from .forms import UploadExcelForm from .models import * from xlwt import * import os from io import StringI...
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池