A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 南槿。 中级黑马   /  2017-3-20 23:55  /  819 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

1.报错: attribute “xxxxx” has already been defined  -----------自定义View
R文件集体大姨妈
可能是atrr.xml文件中定义了同一种属性造成的.解决办法:要事先声明属性 ,然后再从集合里面引用属性 再clear一下就好咯
相关资料:http://blog.csdn.net/janronehoo/article/details/48054147

2.报错:java.lang.RuntimeException: Unable to start activity ComponentInfo{包名/类名}
   使用
.split("-");
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()
在使用自定义 View时,需要设置xmlns设置自己的命名空间 在你使用as时
xmlns:xx="http://schemas.android.com/apk/res-auto" 应该根据建议使用res-auto
在你的自定义view中也要使用
String content = attrs.getAttributeValue("http://schemas.android.com/apk/res-auto", "content");
3.AndroidStudio视图渲染错误Rendering Problems

解决办法:




4.今天在做web开发时,添加restful的插件之后,页面登录便不能运行,错误如下:
发现是这个的在Action提交时会执行以下create()方法      <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-rest-plugin</artifactId>
                        <version>2.3.24</version>
        </dependency>
解决办法
在struts.xml文件中添加如下代码:
<constant name="struts.action.extension" value="xhtml,,xml,json,action"/>
<constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper" />
<constant name="struts.mapper.prefixMapping" value="/rest:rest,:struts"/>
<constant name="struts.convention.action.suffix" value="Controller"/>
<constant name="struts.convention.action.mapAllMatches" value="true"/>
<constant name="struts.convention.default.parent.package" value="rest-default"/>
<constant name="struts.convention.package.locators" value="rest"/>
问题解决。







0 个回复

您需要登录后才可以回帖 登录 | 加入黑马