请问下struts2的ParentPackage问题

请问下大家,如果我在struts2的一个action里配置ParentPackage,既要配置json-default,也要hibernate-default,应该如何配置啊?

2个回答

找到这两个包的定义,然后自己配置个包把两个包的内容都加入
比如,打开json插件的jar包,找到struts-plugin.xml,里面就是json-default的定义
[code="xml"]







[/code]

可以使用include加入两个文件

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
关于是struts2配置json注解问题

这是我的一段注解: @ParentPackage("json-default") @Namespace("/") public class SubjectAction extends BaseAction{ private JSONArray resultObj; @Action(value="subject", results={@Result(type="json")}, params={"contentType", "text/html"}) public String doSubject(){ System.out.println("进入了subject"); List view = new ArrayList(); Map<String, Object> json = new HashMap<String, Object>(); json.put("id", "测试数据"); view.add(json); resultObj=JSONArray.fromObject(view); return SUCCESS; } public JSONArray getResultObj() { return resultObj; } public void setResultObj(JSONArray resultObj) { this.resultObj = resultObj; } } 其中doSubject的方法上面的注解 :params={"contentType", "text/html"} 这句是什么意思?我试过把这段去了,页面也能收到json,或者把"contentType" 改为“resultObj”也能。这句话到底什么意思? 第二:我也页面接收到的json是这样子的:{"resultObj":[{"id":"测试数据"}]} 如果我想要json返回显示为:[{"id":"测试数据"}] 该怎么搞? 在控制台打印 resultObj 是[{"id":"测试数据"}] ;到了页面就多了resultObj 了 ,怎么搞啊?求指导

struts2 出现错误 求帮忙

可能是Jdk环境不兼容的问题,但我以前用时没出现这样的错误啊,请大家给一个修改方向 console 出现以下错误: ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. 17:40:14.334 [localhost-startStop-2] ERROR org.apache.struts2.dispatcher.Dispatcher - Dispatcher initialization failed com.opensymphony.xwork2.config.ConfigurationException: Unable to load configuration. Caused by: com.opensymphony.xwork2.config.ConfigurationException: Parent package is not defined: default 2015-10-15 17:40:14 org.apache.catalina.core.StandardContext filterStart 严重: Exception starting filter struts2 Unable to load configuration. - [unknown location] Caused by: Unable to load configuration. - [unknown location] 2015-10-15 17:40:14 org.apache.catalina.core.StandardContext startInternal 严重: Error filterStart 2015-10-15 17:40:14 org.apache.catalina.core.StandardContext startInternal 严重: Context [/Esell] startup failed due to previous errors 2015-10-15 17:40:14 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/Esell] created a ThreadLocal with key of type [com.sun.faces.util.Util$1] (value [com.sun.faces.util.Util$1@34451610]) and a value of type [java.util.HashMap] (value [{com.sun.faces.patternCache={ = }}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 2015-10-15 17:43:24 org.apache.catalina.startup.HostConfig checkResources 信息: Reloading context [/Esell] 2015-10-15 17:43:25 com.sun.faces.config.ConfigureListener contextInitialized 信息: 初始化上下文 '/Esell' 的 Mojarra 2.0.3 (FCS b03) 2015-10-15 17:43:25 com.sun.faces.spi.InjectionProviderFactory createInstance 信息: JSF1048:有 PostConstruct/PreDestroy 注释。标有这些注释的 ManagedBeans 方法将表示注释已处理。 ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. 17:43:26.301 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR org.apache.struts2.dispatcher.Dispatcher - Dispatcher initialization failed com.opensymphony.xwork2.config.ConfigurationException: Unable to load configuration. Caused by: com.opensymphony.xwork2.config.ConfigurationException: Parent package is not defined: default 2015-10-15 17:43:26 org.apache.catalina.core.StandardContext startInternal 严重: Error filterStart 2015-10-15 17:43:26 org.apache.catalina.core.StandardContext startInternal 严重: Context [/Esell] startup failed due to previous errors 2015-10-15 17:43:26 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/Esell] created a ThreadLocal with key of type [com.sun.faces.util.Util$1] (value [com.sun.faces.util.Util$1@5eace9d4]) and a value of type [java.util.HashMap] (value [{com.sun.faces.patternCache={ = }}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 2015-10-15 17:43:56 org.apache.catalina.startup.HostConfig checkResources 信息: Reloading context [/Esell] 2015-10-15 17:43:57 com.sun.faces.config.ConfigureListener contextInitialized 信息: 初始化上下文 '/Esell' 的 Mojarra 2.0.3 (FCS b03) 2015-10-15 17:43:57 com.sun.faces.spi.InjectionProviderFactory createInstance 信息: JSF1048:有 PostConstruct/PreDestroy 注释。标有这些注释的 ManagedBeans 方法将表示注释已处理。 ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. 17:43:58.424 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR org.apache.struts2.dispatcher.Dispatcher - Dispatcher initialization failed com.opensymphony.xwork2.config.ConfigurationException: Unable to load configuration. Caused by: com.opensymphony.xwork2.config.ConfigurationException: Parent package is not defined: default 2015-10-15 17:43:58 org.apache.catalina.core.StandardContext filterStart 严重: Exception starting filter struts2 Unable to load configuration. - [unknown location] Caused by: Unable to load configuration. - [unknown location] Caused by: Parent package is not defined: default - [unknown location] 2015-10-15 17:43:58 org.apache.catalina.core.StandardContext startInternal 严重: Error filterStart 2015-10-15 17:43:58 org.apache.catalina.core.StandardContext startInternal 严重: Context [/Esell] startup failed due to previous errors 2015-10-15 17:43:58 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/Esell] created a ThreadLocal with key of type [com.sun.faces.util.Util$1] (value [com.sun.faces.util.Util$1@729405ca]) and a value of type [java.util.HashMap] (value [{com.sun.faces.patternCache={ = }}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 2015-10-15 17:44:28 org.apache.catalina.startup.HostConfig checkResources 信息: Reloading context [/Esell] 2015-10-15 17:44:29 com.sun.faces.config.ConfigureListener contextInitialized 信息: 初始化上下文 '/Esell' 的 Mojarra 2.0.3 (FCS b03) 2015-10-15 17:44:29 com.sun.faces.spi.InjectionProviderFactory createInstance 信息: JSF1048:有 PostConstruct/PreDestroy 注释。标有这些注释的 ManagedBeans 方法将表示注释已处理。 ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. 17:44:30.614 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR org.apache.struts2.dispatcher.Dispatcher - Dispatcher initialization failed com.opensymphony.xwork2.config.ConfigurationException: Unable to load configuration. Caused by: com.opensymphony.xwork2.config.ConfigurationException: Parent package is not defined: default 2015-10-15 17:44:30 org.apache.catalina.core.StandardContext filterStart 严重: Exception starting filter struts2 Unable to load configuration. - [unknown location] Caused by: Unable to load configuration. - [unknown location] Caused by: Parent package is not defined: default - [unknown location] 2015-10-15 17:44:30 org.apache.catalina.core.StandardContext startInternal 严重: Error filterStart 2015-10-15 17:44:30 org.apache.catalina.core.StandardContext startInternal 严重: Context [/Esell] startup failed due to previous errors 2015-10-15 17:44:30 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/Esell] created a ThreadLocal with key of type [com.sun.faces.util.Util$1] (value [com.sun.faces.util.Util$1@e15fbe]) and a value of type [java.util.HashMap] (value [{com.sun.faces.patternCache={ = }}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

struts2和spring3整合后,为什么找不到action了

想用spring来管理struts2的action,因为还要向action中注入service,但用@Controller("/roleList")注解后,却找不到action了,这是为何喃? import javax.annotation.Resource; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.InterceptorRef; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import com.xxx.action.BaseAction; import com.xxx.common.bean.PaginationReturnBean; import com.xxx.common.constant.ConstantDefine; import com.xxx.common.security.Description; import com.xxx.common.security.Privilege; import com.xxx.manage.bean.RoleQueryBean; import com.xxx.manage.entity.Role; import com.bizex.manage.service.RoleService; import com.opensymphony.xwork2.ModelDriven; @Controller("/roleList") @Scope("prototype") @ParentPackage("manage") @InterceptorRef("manageStack") public class RoleListAction extends BaseAction implements ModelDriven<RoleQueryBean> { @Resource(name = "roleService") private RoleService roleService; private static final long serialVersionUID = -3029290129233743984L; private RoleQueryBean roleQueryBean = new RoleQueryBean(); private PaginationReturnBean<Role> roles = new PaginationReturnBean<Role>();// 查询角色列表的输出 @Action(results={@Result(location="manage/role_list.jsp")}) public String execute() throws Exception { roles = roleService.getRoleList(roleQueryBean); return SUCCESS; } public RoleQueryBean getModel() { return roleQueryBean; } public PaginationReturnBean<Role> getRoles() { return roles; } public void setRoles(PaginationReturnBean<Role> roles) { this.roles = roles; } }

jboss6.1不加载struts2的注解,找不到action

"struts.convention.default.parent.package"value="default" > "struts.convention.package.locators" value="web,webapp" > "struts.convention.package.locators.basePackage" value="org.common.core.web" /> "struts.ui.theme" value="simple" /> "struts.multipart.maxSize" value="10000000"> "struts.action.extension" value="action,url" />

这个Struts2错误是怎么回事啊?

12:45:29,624 ERROR ParametersInterceptor:34 - Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'police.id' on 'class yh.position.action.center.PoliceUpdateAction: Error setting expression 'police.id' with value '[Ljava.lang.String;@7a0adf91' 12:45:29,670 ERROR Dispatcher:38 - Could not find action or result /pservermy/police_update No result defined for action yh.position.action.center.PoliceUpdateAction and result input at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373) 确定是 ``` <s:textfield name="police.id" /> ``` 报的错。这个类型怎么一致啊

struts2 注解和约定页面跳转问题求解

我想从user文件夹下的admin.left.jsp 跳转至mail 文件夹下的writeMail.jsp 页面 admin.left.jsp form表单action 为 mail/writeMail 执行Action类 @Namespace("/mail") @ParentPackage("struts-default") public class MailAction extends BaseAction { @Action("writeMail") public String ReceiverList(){ List<Users> list=mailServiceImpl.FindReceiverList(); super.getRequest().put("receiverList", list); return "success"; } } 错误如下: There is no Action mapped for namespace [/user/mail] and action name [writeMail] associated with context path [/newoa]. 如果我就是想实现这样的跳转,要怎么实现呢? ![图片说明](https://img-ask.csdn.net/upload/201508/13/1439451703_317758.png)

Struts2 使用redirectAction结果类型传递参数时,会跳转到错误的路径

我希望通过点击下载按钮来跳转到DownloadCount.action并传递参数filename来在数据库中进行一次下载计数,再让filename参数通过redirectAction方式传参给downfile.action来进行下载,但是DownloadCount.action执行完成后会跳转到[http://downfile.action/?filename=1511398398834.xlsx](http://downfile.action/?filename=1511398398834.xlsx ""),问下各位为什么会出现这种情况以及如何解决,谢谢! private.jsp ``` <html> <head> <title>Title</title> </head> <body> <p><a href='<s:url value="upload.jsp"></s:url>'>上传文件</a></p> <table> <tr><td>文件id</td><td>文件名</td><td>文件类型</td><td>文件大小</td><td>上传者</td><td>最后下载时间</td><td>下载次数</td><td>最后下载用户</td><td>文件操作</td></tr> <s:iterator value="filelist" var="file" id="file" > <tr> <td><s:property value="#file.fileid"/></td> <td><s:property value="#file.filename"/></td> <td><s:property value="#file.filetype"/></td> <td><s:property value="#file.filesize"/></td> <td><s:property value="#file.uploader"/></td> <td><s:property value="#file.lastdtime"/></td> <td><s:property value="#file.downtimes"/></td> <td><s:property value="#file.lastdownloader"/></td> <td><a href='<s:url value="DownloadCount.action"><s:param name="filename" value="#file.filename"></s:param></s:url>'>下载</a>&nbsp; <a href='<s:url value="FileDelete.action"><s:param name="filename" value="#file.filename"></s:param><s:param name="uname" value="uname"></s:param></s:url>'>删除</a> </td> </tr> </s:iterator> </table> <s:debug></s:debug> </body> </html> ``` DownloadCountAction.java ``` package com.action; import com.opensymphony.xwork2.ActionSupport; import com.util.DBTools; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; @Namespace("/") @ParentPackage("struts-default") public class DownloadCountAction extends ActionSupport { private String filename; public String getFilename() { return filename; } public void setFilename(String filename) { this.filename = filename; } @Action(value = "DownloadCount",results = { @Result(name = "success",location = "/downfile.action?filename=${filename}",type = "redirectAction") }) public String DownloadCount() throws Exception{ DBTools db=new DBTools(); db.FileDownload(filename); return SUCCESS; } } ``` struts.xml中关于downfile.action的配置 ``` <action name="downfile" class="com.action.DownFileAction" method="downloadFile"> <result name="success" type="stream"> <param name="bufferSize">4096</param> <param name="contentDisposition"> attachment;filename="${filename}" </param> <param name="inputName">downFile</param> </result> </action> ``` DownFileAction.java ``` package com.action; import com.opensymphony.xwork2.ActionSupport; import com.util.DBTools; import org.apache.struts2.ServletActionContext; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; public class DownFileAction extends ActionSupport{ private String filename; public String getFilename() { return filename; } public void setFilename(String filename) throws Exception { this.filename = new String(filename.getBytes("ISO8859-1"),"utf-8"); } public String downloadFile() throws Exception { return SUCCESS; } public InputStream getDownFile()throws Exception{ String path=ServletActionContext.getServletContext().getRealPath("/WEB-INF/uploadlist"); File file=new File(path+"/"+this.getFilename()); InputStream inputStream=new FileInputStream(file); return inputStream; } } ```

struts2中处理自定义异常的问题,求大神帮忙

先上代码: struts.xml ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <!-- 请求参数的编码方式 --> <constant name="struts.i18n.encoding" value="UTF-8" /> <!-- 当struts.xml改动后,是否重新加载。默认值为false(生产环境下使用),开发阶段最好打开 --> <constant name="struts.configuration.xml.reload" value="true" /> <!-- 设置浏览器是否缓存静态内容。默认值为true(生产环境下使用),开发阶段最好关闭 --> <constant name="struts.serve.static.browserCache" value="false" /> <!-- 将struts2委托Spring管理 --> <constant name="struts.objectFactory" value="spring" /> <!-- 是否开启动态方法调用 --> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <!-- 是否使用struts的开发模式。开发模式会有更多的调试信息。默认值为false(生产环境下使用),开发阶段最好打开 --> <constant name="struts.devMode" value="true" /> <!-- 设置默认的父包,一般我们都设置一个default包继承自struts-default。大部分类再继承default。如果有特殊的类需要特殊的包,只能在action中再指定父包了。 --> <constant name="struts.convention.default.parent.package" value="default" /> <!-- 默认配置包路径包含action,actions,struts,struts2的所有包都会被struts作为含有Action类的路径来搜索。通过设置struts.convention.package.locators属性来修改这个配置。 --> <constant name="struts.convention.package.locators" value="action,actions,controller,web" /> <!-- 约定Action类名:要求Action的命名必须以Action为后缀,可以使用下面常量来修改后缀限制 --> <constant name="struts.convention.action.suffix" value="Action" /> <package name="default" extends="struts-default"> <global-results> <!-- <result name="error1">/commons/error1.jsp</result> --> <result name="error2">/commons/error2.jsp</result> <result name="login">/login/login.jsp</result> </global-results> <global-exception-mappings> <!-- <exception-mapping result="error1" exception="java.lang.Exception"/> --> **<exception-mapping result="error2" exception="com.lz.shop.web.action.MyException" />** <exception-mapping result="sqlException" exception="java.sql.SQLException" /> </global-exception-mappings> </package> </struts> ``` <exception-mapping result="error2" exception="com.lz.shop.web.action.MyException" /> 这一句为什么会无效呀?试了很多办法都不行 求大神解答! 自定义异常类: MyException.java ``` package com.lz.shop.web.action; public class MyException extends Exception { /** * */ private static final long serialVersionUID = -4567535714727601736L; public MyException() { super(); } private String message="bmddddd"; public MyException(String message) { this.message = message; } public String getMessage() { return message; } } ``` error2.jsp ``` <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>ERROR1</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> </head> <body> <span>ERROR2</span> <s:fielderror></s:fielderror> <s:property value="exception.message" /> </body> </html> ``` Action测试类: LoginAction.java ``` package com.lz.shop.web.action; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import com.lz.shop.entity.base.User; import com.lz.shop.web.BaseSupport; @Scope @Controller @Namespace("/user") @ParentPackage("default") public class LoginAction extends BaseSupport { /** * */ private static final long serialVersionUID = 6336185736252504861L; private User user; /** * 验证登陆 * * @return */ @Action(value = "loginAction", results = { @Result(name = "success", location = "/index.jsp", type = "redirect"), @Result(name = "input", location = "/login/login.jsp") }) public String login() { //抛个空指针异常来测试 if (user.getUsername() == "1" && user.getPassword() == "1") { System.out.println("success"); return "success"; } else { System.out.println("input"); return "input"; } } public User getUser() { return user; } public void setUser(User user) { this.user = user; } } ``` struts2版本是2.2.1 求大神支招!!!

struts2中json的两个问题

问题1: 每个Action类都可以指定@ParentPackage,当返回值是json类型的时候,就需要在这个Action的class上加上 @ParentPackage("json-default"),再指定@Result的type="json",然后这个Action中的方法的返回结果就是json的了,返回html的action就不需要这些设置,通常一个业务对象会有一些返回json的action和非json的action,不知道有没有办法把这两种操作整在一个class里面 问题2: json类型的返回值,可以设置includeProperties,让符合设置正则表达式的属性序列化,这个includeProperties我需要根据实际情况计算,于是我设置result的params如下 params={"includeProperties", "${myInculdeProperties}" .... 但是设置不上去,不知道各位有没有遇到过这种问题 [b]问题补充:[/b] 谢谢 yourgame 的回复,我的action配置使用的是annotation,主要是想动态去设置includeProperties,比如这个用户的请求是“result”,另一个用户的请求是“result2”。 不过现在问题2已经解决了,在action的方法中,直接返回JSONResult就可以了

Exception starting filter struts2的错误

严重: Exception starting filter struts2 Unable to load configuration. - [unknown location] at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:502) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: Unable to load configuration. - [unknown location] at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490) ... 29 more Caused by: Parent package is not defined: json-default - [unknown location] at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildPackageContext(XmlConfigurationProvider.java:670) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:519) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:292) at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:250) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) ... 31 more 2016-10-20 16:36:30 org.apache.catalina.core.StandardContext start 严重: Error filterStart

严重: Unable to find parent packages json-default

一直出现这个问题 网上找了好久都解决不了(有struts2-json-plugin:2.1.8,json-lib) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <!--<constant name="struts.objectFactory" value="spring"/>--> <!--<constant name="com.opensymphony.xwork2.ObjectFactory" value="spring" />--> <!-- 配置 不用重启服务器就可以改代码 --> <!-- value 默认false, 改为true 为开发模式 --> <constant name="struts.devMode" value="true"/> <!-- action动态方法调用 Dynamic Method Invocation--> <constant name="struts.enable.DynamicMethodInvocation" value="true" /> <!-- 编码方式 --> <constant name="struts.custom.i18n.encoding" value="UTF-8" /> <package name="Login" namespace="/" extends="json-default"> <action name="login" class="com.zb.Action.LoginAction"> <result name="success" type="json"> <!--/success.jsp--> <param name="excludeProperties">username, password</param> </result> <result name="error" type="json"> <!--/error.jsp--> <param name="excludeProperties">username, password</param> </result> </action> </package> </struts>

struts2注解url没跳转到action里的方法,没报错也没跳转

我补下图片: ![图片说明](https://img-ask.csdn.net/upload/201509/21/1442781387_310218.png) package com.AppServer.action; import javax.annotation.Resource; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.ExceptionMapping; import org.apache.struts2.convention.annotation.ExceptionMappings; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.stereotype.Service; import com.AppServer.bean.User; import com.AppServer.dao.UserDAO; import com.AppServer.service.UserService; import com.demo.interceptor.MethodCacheInterceptor; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven; @Controller @ParentPackage("struts-default") @Namespace(value = "msgAction") @ExceptionMappings({ @ExceptionMapping(exception = "java.lange.RuntimeException", result = "error") }) public class MsgAction extends ActionSupport { private String username; private String password; @Resource private UserService userService; @Action(value = "msg" , results = { @Result(name = "success", location = "/success.jsp"), @Result(name = "failure", location = "/failure.jsp"), @Result(name = "error", location = "/login.jsp")}) //获取用户信息 public String getInfo() { System.out.println("进来玩"); return SUCCESS; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } url访问如下:http://127.0.0.1:8080/AppServer_1.1/msgAction/msg.do 访问之后没报错,没进去getInfo这个方法 struts2.xml: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <!-- 指定Web应用的默认编码,相当于调用request的setCharacterEncoding方法 --> <constant name="struts.i18n.encoding" value="UTF-8" /> <!-- 设置浏览器是否缓存静态内容,默认值为true(生产环境下使用),开发阶段最好关闭 --> <constant name="struts.serve.static.browserCache" value="false" /> <!-- 当Struts2的配置文件修改后,系统是否自动重新加载配置文件,默认值为false(生产环境下使用),开发阶段最好打开 --> <constant name="struts.configuration.xml.reload" value="true" /> <!-- 开发模式下使用,这样可以打印出更详细的日志信息 --> <constant name="struts.devMode" value="true" /> <!-- 默认的视图主题 --> <constant name="struts.ui.theme" value="simple" /> <!-- 把Action对象交给Spring创建和管理 --> <constant name="struts.objectFactory" value="spring" /> <!-- Struts2处理的请求后缀,默认值是action --> <constant name="struts.action.extension" value="do" /> <!-- 国际化资源文件 <constant name="struts.custom.i18n.resources" value="globalMessages" /> --> <package name="msg" extends="struts-default"> <default-action-ref name="indexPage" /> <global-results> <result name="exceptionPage">/error/exceptionPage.jsp</result> </global-results> <global-exception-mappings> <exception-mapping result="exceptionPage" exception="java.lang.Exception" /> </global-exception-mappings> <action name="indexPage"> <result>/login.jsp</result> </action> <!-- <action name="msg" method="getInfo" class="com.AppServer.action.MsgAction"> <result name="success">/success.jsp</result> <result name="failure">/failure.jsp</result> <result name="error">/login.jsp</result> </action> --> </package> </struts> application.xml: <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd" default-autowire="byName" default-lazy-init="true"> <!-- 说明:下面有的Bean配置提供了多种方案,请根据需要采用某一种(别忘了注释掉其他同类方案) --> <!-- 自动扫描Spring注解配置 并保证@Required,@Autowired的属性被注入--> <context:component-scan base-package="com" /> <!-- 自动加载属性配置文件 --> <context:property-placeholder location="classpath:jdbc.properties" /> <!-- 配置数据源:方法一,使用C3P0方式(推荐) --> <!-- <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" --> <!-- destroy-method="close" --> <!-- p:driverClass="${jdbc.driverClassName}" --> <!-- p:jdbcUrl="${jdbc.url}" --> <!-- p:user="${jdbc.username}" --> <!-- p:password="${jdbc.password}" /> --> <!-- <context:property-placeholder location="classpath:jdbc.properties"/> --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${jdbc.driverClassName}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <!-- property池启动时的初始值 --> <property name="password" value="${jdbc.password}"/> <!-- 连接name="initialSize" value="${initialSize}"/>--> <property name="initialSize" value="1"/> <!-- 连接池的最大值 --> <property name="maxActive" value="500"/> <!-- 最大空闲值.当经过一个高峰时间后,连接池可以慢慢将已经用不到的连接慢慢释放一部分,一直减少到maxIdle为止 --> <property name="maxIdle" value="2"/> <!-- 最小空闲值.当空闲的连接数少于阀值时,连接池就会预申请去一些连接,以免洪峰来时来不及申请 --> <property name="minIdle" value="1"/> </bean> <!-- 配置数据源:方法二,使用DBCP方式(不推荐) --> <!-- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}" /> --> <!-- 配置数据源:方法三,使用JNDI方式 --> <!-- <jee:jndi-lookup id="dataSource" jndi-name="${jndi.name}" /> --> <!-- 配置Hibernate的数据源代理工厂:方法一,使用p属性通配符,按文件名搜索匹配的映射文件 --> <!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource" > <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop> </props> </property> 加载hibernate的jpa注解形式实体 <property name="packagesToScan"> <list> <value>com.xmm.demo.domain*</value> </list> </property> </bean> --> <!-- 配置Hibernate的数据源代理工厂:方法二,使用list集合,按文件名搜索匹配的映射文件 --> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource"> <property name="mappingLocations"> <list> <value>classpath*:/com/**/*.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop> </props> </property> </bean> <!-- 配置Hibernate的数据源代理工厂:方法三,使用p属性通配符,按目录搜索映射文件 --> <!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource" p:mappingDirectoryLocations="classpath*:/com/**/domain"> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop> </props> </property> </bean> --> <!-- 配置Hibernate的数据源代理工厂:方法四,使用hibernate.cfg.xml --> <!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource" p:configLocation="classpath:hibernate.cfg.xml"> </bean> --> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager" p:sessionFactory-ref="sessionFactory" /> <!-- 配置声明式事务:方法一,在Service实现类或者public实现方法上使用注解@Transactional,则此类或方法就会启用事务机制 --> <!-- <tx:annotation-driven transaction-manager="transactionManager" /> --> <!-- 配置声明式事务:方法二,使用tx/aop命名空间的配置(其实还有方法三,由于快要过时不推荐使用了,这里就不给出方法三的配置了) --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="insert*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="edit*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="new*" propagation="REQUIRED" /> <tx:method name="set*" propagation="REQUIRED" /> <tx:method name="remove*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="change*" propagation="REQUIRED" /> <tx:method name="get*" propagation="REQUIRED" read-only="true" /> <tx:method name="find*" propagation="REQUIRED" read-only="true" /> <tx:method name="load*" propagation="REQUIRED" read-only="true" /> <tx:method name="search*" propagation="REQUIRED" read-only="true" /> <tx:method name="*" propagation="REQUIRED" read-only="true" /> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id="mypointcut" expression="execution(* com.**.service..*.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="mypointcut" /> </aop:config> <!-- 下面三个Bean的配置可有可无,但配置后用处更大,通常用于BaseDao类、其他Dao类或特殊工具类中 --> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate4.HibernateTemplate" p:sessionFactory-ref="sessionFactory" /> <bean id="hibernateDaoSupport" class="org.springframework.orm.hibernate4.support.HibernateDaoSupport" p:hibernateTemplate-ref="hibernateTemplate" abstract="true"/> <bean id="sessionFactoryUtils" class="org.springframework.orm.hibernate4.SessionFactoryUtils" abstract="true"/> </beans> tomcat6.0:服务器运行正常: 九月 21, 2015 4:22:24 上午 org.apache.catalina.core.AprLifecycleListener init 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Java\jdk1.7.0\bin;E:\tomcat6\bin 九月 21, 2015 4:22:25 上午 org.apache.coyote.http11.Http11Protocol init 信息: Initializing Coyote HTTP/1.1 on http-8080 九月 21, 2015 4:22:25 上午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 516 ms 九月 21, 2015 4:22:25 上午 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 九月 21, 2015 4:22:25 上午 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.41 九月 21, 2015 4:22:25 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory AppServer_1.1 九月 21, 2015 4:22:25 上午 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(E:\tomcat6\webapps\AppServer_1.1\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 九月 21, 2015 4:22:26 上午 org.apache.catalina.core.ApplicationContext log 信息: Set web app root system property: 'webapp.root' = [E:\tomcat6\webapps\AppServer_1.1\] 九月 21, 2015 4:22:26 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing log4j from [classpath:log4j.properties] 九月 21, 2015 4:22:26 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 九月 21, 2015 4:22:34 上午 org.apache.coyote.http11.Http11Protocol start 信息: Starting Coyote HTTP/1.1 on http-8080 九月 21, 2015 4:22:34 上午 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 九月 21, 2015 4:22:34 上午 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/23 config=null 九月 21, 2015 4:22:34 上午 org.apache.catalina.startup.Catalina start 信息: Server startup in 9364 ms 测试定时任务:2015-09-21 04:30:00:074 测试定时任务:2015-09-21 04:40:00:004 url访问地址:http://127.0.0.1:8080/AppServer_1.1/msgAction/msg.do 没有进去action的getinfo方法,这是为什么?而且也没有任何的报错!!!!!!!!!!!

初步使用struts2的一个问题,纠结了半天,熟悉struts2的帮忙看看

<p>web.xml文件:</p> <p> </p> <pre name="code" class="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;filter&gt; &lt;filter-name&gt;struts2&lt;/filter-name&gt; &lt;filter-class&gt;org.apache.struts2.dispatcher.FilterDispatcher&lt;/filter-class&gt; &lt;init-param&gt; &lt;param-name&gt;actionPackages&lt;/param-name&gt; &lt;param-value&gt;com.wrk.bi.action&lt;/param-value&gt; &lt;/init-param&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;struts2&lt;/filter-name&gt; &lt;url-pattern&gt;*.action&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;/web-app&gt; </pre>   <p> struts.xml</p> <p> </p> <pre name="code" class="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"&gt; &lt;struts&gt; &lt;constant name="struts.devMode" value="true" /&gt; &lt;constant name="struts.mapper.composite" value="struts" /&gt; &lt;constant name="struts.convention.default.parent.package" value="default-package" /&gt; &lt;constant name="struts.i18n.encoding" value="UTF-8" /&gt; &lt;constant name="struts.locale" value="zh_CN" /&gt; &lt;constant name="struts.multipart.maxSize" value="100000000" /&gt; &lt;package name="default-package" extends="struts-default"&gt; &lt;global-results&gt; &lt;result name="failure"&gt;/common/exception.jsp&lt;/result&gt; &lt;/global-results&gt; &lt;global-exception-mappings&gt; &lt;exception-mapping name="runtimeexception" exception="java.lang.RuntimeException" result="failure" /&gt; &lt;/global-exception-mappings&gt; &lt;/package&gt; &lt;/struts&gt; </pre> <p> </p> <p>Action类代码:</p> <p> </p> <pre name="code" class="java">package com.wrk.bi.action; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; import com.opensymphony.xwork2.ActionSupport; @SuppressWarnings("serial") @Namespace("ref/WorkDeploy") public class WorkDeployAction extends ActionSupport{ private String SUCCESS; private String ERROR; @Action(value = "queryWork") public String queryWork(){ System.out.println("2222222222"); return SUCCESS; } public String getSUCCESS() { return SUCCESS; } public void setSUCCESS(String success) { SUCCESS = success; } public String getERROR() { return ERROR; } public void setERROR(String error) { ERROR = error; } } </pre> <p> </p> <p>报错:</p> <p><span style="font-family: Simsun; font-size: medium;"> <h2>Struts Problem Report</h2> <p>Struts has detected an unhandled exception:</p> <div id="exception-info"> <table border="0"><tbody> <tr> <td> <strong>Messages</strong>:</td> <td> </td> </tr> <tr> <td> <strong>File</strong>:</td> <td>org/apache/struts2/impl/StrutsActionProxy.java</td> </tr> <tr> <td> <strong>Line number</strong>:</td> <td>69</td> </tr> </tbody></table> </div> <div id="stacktraces"> <hr> <h3>Stacktraces</h3> <div class="stacktrace" style="padding-left: 0em;"> <strong>java.lang.NullPointerException</strong> <div> <pre> org.apache.struts2.impl.StrutsActionProxy.getErrorMessage(StrutsActionProxy.java:69) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:500) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445) java.lang.Thread.run(Thread.java:662) </pre> </div> </div> </div> <div class="footer"> <hr> <p>You are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set:</p> <pre> struts.devMode=false </pre> </div> <div class="footer">in your <code>WEB-INF/classes/struts.properties</code> file.</div> <div class="footer"><br></div> <div class="footer"><br></div> </span></p>

Struts的注解方式无效

报错: No result defined for action manage.action.MultiplyAction$$EnhancedByS2AOP$$1f8a98 and result mytest MultiplyAction.java ``` @ParentPackage("manage") @SuppressWarnings("serial") @Results({ @Result(name = "success", value = "WEB-INF/index.jsp"), @Result(name = "mytest", value = "WEB-INF/index.jsp") }) ``` web.xml ``` <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> <init-param> <param-name>actionPackages</param-name> <param-value>manage.action</param-value> </init-param> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> ``` 可能是在哪里错了呢

struts2.1.8 ,使用自带json插件struts2-json-plugin-2.1.8.1.客户端得不到json对象,弹出下载action提示框

struts2.1.8 ,使用自带struts2-json-plugin-2.1.8.1.jar把action对象返回客户端的json对象。注释配置,客户端总是弹出下载页面,打开后是正常的json数据,各位可以帮忙看看?代码很简单,困老好几天了,非常感谢,代码如下: Java代码 import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; import org.apache.struts2.convention.annotation.Results; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import com.test.product.bean.ScmProdUnit; import com.opensymphony.xwork2.ActionSupport; @Controller @Scope("prototype") @ParentPackage("json-default") @Results( { @Result(name = "success",type = "json") }) public class JsonTestAction extends ActionSupport { private static final long serialVersionUID = -6933656224417288484L; private ScmProdUnit scmProdUnit; // @Action(results={@Result(type="json",name="success",params ={"root","scmProdUnit" })}) public String querybyB() throws Exception { System.err.println("2222222"); scmProdUnit = new ScmProdUnit(); scmProdUnit.setId(1); scmProdUnit.setCode("jsoncode"); scmProdUnit.setName("json数据"); scmProdUnit.setRemark("测试"); return SUCCESS; } public ScmProdUnit getScmProdUnit() { return scmProdUnit; } public void setScmProdUnit(ScmProdUnit scmProdUnit) { this.scmProdUnit = scmProdUnit; } } } @Controller @Scope("prototype") @ParentPackage("json-default") @Results( { @Result(name = "success",type = "json") }) public class JsonTestAction extends ActionSupport { private static final long serialVersionUID = -6933656224417288484L; private ScmProdUnit scmProdUnit; // @Action(results={@Result(type="json",name="success",params ={"root","scmProdUnit" })}) public String querybyB() throws Exception { System.err.println("2222222"); scmProdUnit = new ScmProdUnit(); scmProdUnit.setId(1); scmProdUnit.setCode("jsoncode"); scmProdUnit.setName("json数据"); scmProdUnit.setRemark("测试"); return SUCCESS; } public ScmProdUnit getScmProdUnit() { return scmProdUnit; } public void setScmProdUnit(ScmProdUnit scmProdUnit) { this.scmProdUnit = scmProdUnit; } } } ProdUnit 只是一个很简单的pojo,前台代码如下 Java代码 function getjsontest() { $.post("json-test!querybyB.action", { },function(returnData,status) { if("success" == status) { alert(returnData.length); } },"json" ); } function getjsontest() { $.post("json-test!querybyB.action", { },function(returnData,status) { if("success" == status) { alert(returnData.length); } },"json" ); } 当我在一个测试页面button里掉这个function时候,总是弹出action下载页面,下载打开后,里面的json对象数据好像没错啊,如下: {"scmProdUnit":{"code":"jsoncode","id":1,"name":"json数据","remark":"测试"}},调用js的时候returnData总是返回null值,为啥啊?郁闷了几天了,麻烦看看

配置struts时候提示的,namespace,

2016 一月 04 17:59:56[juice] ERROR [http-apr-8080-exec-1] com.opensymphony.xwork2.util.logging.commons.CommonsLogger.error(38) |Exception occurred during processing request: There is no Action mapped for namespace [/] and action name [undefined] associated with context path [/JuiceDemo]. There is no Action mapped for namespace [/] and action name [undefined] associated with context path [/JuiceDemo]. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2462) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2451) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

配置文件缺什么呀?Struts2+hibernate

严重: Exception starting filter struts2 Unable to load configuration. - [unknown location] at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:493) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: Unable to load configuration. - [unknown location] at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479) ... 14 more Caused by: Parent package is not defined: default - [unknown location] at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildPackageContext(XmlConfigurationProvider.java:674) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:523) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:295) at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:264) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) ... 17 more ``` ```

struts2 [unknown location]

There is no Action mapped for namespace [/] and action name [user-add] associated with context path [/OA]. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:192) org.apache.struts2.factory.StrutsActionProxy.prepare(StrutsActionProxy.java:63) org.apache.struts2.factory.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:37) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:546) org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81) org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:113) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) You are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set: struts.devMode=false in your WEB-INF/classes/struts.properties file. WEB-INF/classess/struts.xml: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <!-- 配置为开发模式 --> <constant name="struts.devMode" value="true" /> <!-- 把扩展名配置为action结尾 --> <constant name="struts.action.extension" value="action"></constant> <!-- 把主题配置为simple --> <constant name="struts.ui.theme" value="simple"></constant> <!-- 动态调用方法 --> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <!-- 默认package --> <package name="default" namespace="/" extends="struts-default"> <action name="user-*" class="userAction" method="{1}"> <result name="list">/WEB-INF/jsp/action/list.jsp</result> <result name="editUI">/WEB-INF/jsp/action/edit.jsp</result> <result name="tolist" type="redirectAction">user-list</result> </action> </package> </struts> UserAction.java: package com.ing.oa.action; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import com.opensymphony.xwork2.ActionSupport; @Controller @Scope("prototype") public class UserAction extends ActionSupport { /* 列出所有user */ public String list() { return "list"; } /* 删除user */ public String delete() { return "tolist"; } /* 增加user */ public String add() { return "tolist"; } /* 增加userUI */ public String save() { return "editUI"; } /* 修改user */ public String edit(){ return "tolist"; } /* 修改userUI */ public String editUI() { return "editUI"; } } 问题描述:该环境是SSH框架整合后。执行http://127.0.0.1:8080/OA/user-list.action是可行的,但是把list换成add或edit和editUI即报了上述错误。大神帮忙!求解。

struts2接收json数据时出现问号?

我在编写移动端网站,前台使用jqm,后台使用ssh框架。 现在的问题是: 后台向前台发送json数据,格式正常。 前台向后台发送json数据,出现?乱码。 前台代码: $("#submit").on("tap", function() { $.ajax({ cache: false, type: "POST", url: "http://localhost:8080/oa/addMeetingRoomOrderAJAX.action?callback=?", data: $('#form1').serialize(), dataType: "json", success: function(data) { alert(data.msg); } }); }); 前台表单元素的命名都是用:order.roomId、order.roomName的格式。 后台代码: @ParentPackage("json-default") @Results({ @Result(name = "addMeetingRoomOrderAJAXOK", type = "json", params = { "includeProperties", "msg", "callbackParameter", "callback" }) }) public class MeetingRoomOrderAction extends ActionSupport { private static final long serialVersionUID = 1L; private String msg; private MeetingRoomOrder order; @Resource private MeetingRoomOrderBiz meetingRoomOrderBiz; @Action(value = "addMeetingRoomOrderAJAX") public String addMeetingRoomOrderAJAX() { try { meetingRoomOrderBiz.add(order); msg = "保存成功!"; } catch (Exception e) { e.printStackTrace(); msg = "保存失败!"; } return "addMeetingRoomOrderAJAXOK"; } 数据已正常写入数据库,就是格式是乱码,问题出在哪里呢?

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

删库了,我们一定要跑路吗?

在工作中,我们误删数据或者数据库,我们一定需要跑路吗?我看未必,程序员一定要学会自救,神不知鬼不觉的将数据找回。 在 mysql 数据库中,我们知道 binlog 日志记录了我们对数据库的所有操作,所以 binlog 日志就是我们自救的利器。 接下来就来开启程序员自救之路。 想要自救成功,binlog 这把利器一定要好,在自己之前,我们一定要确定我们有 binlog 这把利器,以下就是确保有 bi...

再不跳槽,应届毕业生拿的都比我多了!

跳槽几乎是每个人职业生涯的一部分,很多HR说“三年两跳”已经是一个跳槽频繁与否的阈值了,可为什么市面上有很多程序员不到一年就跳槽呢?他们不担心影响履历吗? PayScale之前发布的**《员工最短任期公司排行榜》中,两家码农大厂Amazon和Google**,以1年和1.1年的员工任期中位数分列第二、第四名。 PayScale:员工最短任期公司排行榜 意外的是,任期中位数极小的这两家公司,薪资...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

华为初面+综合面试(Java技术面)附上面试题

华为面试整体流程大致分为笔试,性格测试,面试,综合面试,回学校等结果。笔试来说,华为的难度较中等,选择题难度和网易腾讯差不多。最后的代码题,相比下来就简单很多,一共3道题目,前2题很容易就AC,题目已经记不太清楚,不过难度确实不大。最后一题最后提交的代码过了75%的样例,一直没有发现剩下的25%可能存在什么坑。 笔试部分太久远,我就不怎么回忆了。直接将面试。 面试 如果说腾讯的面试是挥金如土...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

现代的 “Hello, World”,可不仅仅是几行代码而已

作者 |Charles R. Martin译者 | 弯月,责编 | 夕颜头图 |付费下载自视觉中国出品 | CSDN(ID:CSDNnews)新手...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

程序员毕业去大公司好还是小公司好?

虽然大公司并不是人人都能进,但我仍建议还未毕业的同学,尽力地通过校招向大公司挤,但凡挤进去,你这一生会容易很多。 大公司哪里好?没能进大公司怎么办?答案都在这里了,记得帮我点赞哦。 目录: 技术氛围 内部晋升与跳槽 啥也没学会,公司倒闭了? 不同的人脉圈,注定会有不同的结果 没能去大厂怎么办? 一、技术氛围 纵观整个程序员技术领域,哪个在行业有所名气的大牛,不是在大厂? 而且众所...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

立即提问
相关内容推荐