我正在使用MyEclipse开发一个非常简单的Java Struts项目.一切都工作正常,直到我想StringUtils在org.apache.commons.lang中使用该类.在MyEclipse我导入的包就像
import org.apache.commons.lang.StringUtils;
Run Code Online (Sandbox Code Playgroud)
我将commons-lang-2.4的Jar文件添加到我的构建路径中.这一切都很好,花花公子,我得到了Intellisense,没有Eclipse或任何错误.现在,当我去做一个时mvn clean package,我得到一个错误说
包org.apache.commons.lang不存在
我检查了我的war/Pom.xml文件,并确实将其声明为依赖项
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
根据我的研究,我认为Maven应该下载软件包并将其安装到我的本地存储库(如果它不存在).我检查了存储库,jar文件就在那里.我认为jar文件必须已损坏所以我删除了commons-lang文件夹以获得commons-lang的新下载.现在这是我的想法,在我从本地存储库中删除它并运行后mvn clean package,它出去并下载commons-lang-2.1 .pom和jar(即使pom.xml有2.4)但仍然给出了编译失败,说包org.apache.commons.lang不存在.
我没有使用Maven很长时间,所以我不确定如何解决这个问题.我错过了什么吗?我是否需要在其他地方的另一个pom.xml文件中添加依赖项?
我正在使用http://harvesthq.github.com/chosen/上的Chosen jQuery小部件.它在大多数浏览器的应用程序中运行良好,但在"兼容性视图"下的IE8中无效.这给我带来了一个问题,因为我公司的Intranet 兼容性视图是Intranet站点的默认设置.您可以通过转到上面的链接并切换到IE中的兼容性视图来测试我的问题.
我没有完全放弃它的原因是因为在这个页面http://davidwalsh.name/dw-content/jquery-chosen.php有人得到它在IE中的兼容性视图中工作(参见自己).
我正在使用jQuery 1.6.2和Chosen 0.9.5.兼容性视图下的Windows XP和IE 8.0.6001.如果我在开发工具中将浏览器模式切换到IE8,它可以正常工作,但我不希望每个用户都必须这样做.有没有人之前使用过这个插件并让它在IE8的兼容模式下工作?
<script type="text/javascript"> $("#groupsList").data("placeholder", "Select Groups").chosen();</script>
Run Code Online (Sandbox Code Playgroud) 我正试图在我的tomcat环境中追踪配置问题.我们的生产服务器正在运行tomcat安装并从共享NFS挂载中读取战争.
但是,当我使用独立的盒子(使用它们的配置)尝试相同的战争时,我收到下面发布的错误.
有趣的是,如果我将WEB-INF/lib中的所有jar解压缩到WEB-INF/classes中,这个错误就会消失.
所以,似乎某些东西阻止了应用程序加载WEB-INF/lib路径,但我不能在我的生活中找到任何会导致这种情况的tomcat设置,因为它正在检测应用程序和配置,只是没有包括罐子.
有任何想法吗?
重度:类org.springframework.web.context.ContextLoaderListener抛出java.lang.ClassNotFoundException的错误配置应用程序监听器:org.springframework.web.context.ContextLoaderListener在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387 )在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)在org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786)在org.apache.catalina.core.StandardContext.在org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)在org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)在org.apache开始(StandardContext.java:4342) .catalina.core.StandardHost.addChild(StandardHost.java:525)在org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)在org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java :553)org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)在org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)在org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent (LifecycleSupport.java:117)在org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)在org.apache.catalina.core.StandardHost.start(StandardHost.java:719)在org.apache. catalina.core.ContainerBase.start(ContainerBase.java:1045)在org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)在org.apache.catalina.core.StandardService.start(StandardService.java: 516)在org.apache.catalina.core.StandardServer.start(StandardServer.java:710)在org.apache.catalina.startup.Catalina.start(Catalina.java:578)在sun.reflect.NativeMethodAccessorImpl.invoke0(母语法)在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)在java.lang.reflect.Me thod.invoke(Method.java:597)org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)12月20日2011下午四点二十分38秒org.apache.catalina.core.StandardContext listenerStart严重:错误配置类org.springframework.security.web.session.HttpSessionEventPublisher抛出java.lang.ClassNotFoundException的应用监听器:org.springframework.security.web .session.HttpSessionEventPublisher在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)在org.apache.catalina.core .StandardContext.listenerStart(StandardContext.java:3786)在org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)在org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)在org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)at org.apache.catalina.core.StandardHost.的addChild(StandardHost.java:525)在org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)在org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)在org.apache .catalina.startup.HostConfig.deployApps(HostConfig.java:488)在org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)在org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java :311)在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)在org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)在org.apache.catalina.core. StandardHost.start(StandardHost.java:719)在org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)在org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)在组织.apache.catalina.core.StandardService.start(StandardService.java:516)位于org.apache.catalina.startup.Catalina.start(Catalina)的org.apache.catalina.core.StandardServer.start(StandardServer.java:710)的.java:578)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)在java的. lang.reflect.Method.invoke(Method.java:597)org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)org.apache.catalina.startup.Bootstrap.main(Bootstrap.java: 413)
我是struts的新手.我正在使用Struts2.请任何人告诉我如何在Session有超时后自动重定向jsp页面.
缩小的 JavaScript文件中的注释会发生什么?浏览器如何知道评论的结尾何时将所有内容压缩到一行?举个小例子,我有像这样的Google跟踪代码:
//Google tracking
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '123456']);
Run Code Online (Sandbox Code Playgroud)
缩小版将所有内容都拉成一行
// Google tracking var _gaq = _gaq || []; _gaq.push(['_setAccount', '123456']);
Run Code Online (Sandbox Code Playgroud)
有更多的陈述,但是当我在编辑器中检查JavaScript代码时,它看起来像一个巨大的评论(或多或少).是否有隐藏的字符告诉浏览器何时结束评论或者此代码是否未被执行?
我有一个asp:GridView声明如下:
<asp:GridView runat="server" id="dg_myprojects" AllowSorting="true" AutoGenerateColumns="false" Width="900px" CssClass="Grid" OnSorting="TaskGridView_SortingMine" OnRowCommand="MyProjectList_RowCommand" DataKeyNames="project_id" OnRowDataBound="Ds_my_projects_RowDataBound">
<AlternatingRowStyle CssClass="alternateRow" />
<HeaderStyle CssClass="GridHeader" />
<Columns>
<asp:BoundField DataField="project_name" HeaderText="Project Name" SortExpression="project_name"/>
<asp:BoundField DataField="description" HeaderText="Description" SortExpression="description" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="role" HeaderText="Role" SortExpression="role" />
<asp:BoundField DataField="start_date" HeaderText="Start Date" SortExpression="start_date" DataFormatString="{0:d}"/>
<asp:BoundField DataField="end_date" HeaderText="End Date" SortExpression="end_date" DataFormatString="{0:d}" />
<asp:BoundField DataField="client" HeaderText="Client" SortExpression="client" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="DeleteButton" CommandArgument='<%# Eval("project_id") %>' CommandName="Remove" runat="server">Remove</asp:LinkButton>
</ItemTemplate></asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="project_id" DataNavigateUrlFormatString="EditProject.aspx?pID={0}" Text="Edit"/>
</Columns>
</asp:GridView>
Run Code Online (Sandbox Code Playgroud)
我的问题是100%美学.为长描述而发生的自动换行使表格看起来很俗气.我想用长描述做的是当描述太长时有一个省略号(...)
很长的描述等等......
我找不到内置的方法,所以我决定尝试实现OnRowDataBoundGridView的这个.
protected void Ds_my_projects_RowDataBound(object sender, …Run Code Online (Sandbox Code Playgroud) 我们在Word中创建了一个绝对庞大的帮助文档,这个文档用于生成更大规模且非常复杂的HTM文档.使用C#和这个库,我想只在我的应用程序中的任何一点抓取并显示该文件的一部分.部分分为这样:
<!--logical section starts here -->
<div>
<h1><span style='mso-spacerun:yes'></span><a name="_Toc325456104">Section A</a></h1>
</div>
<div> Lots of unnecessary markup for simple formatting... </div>
.....
<!--logical section ends here -->
<div>
<h1><span style='mso-spacerun:yes'></span><a name="_Toc325456104">Section B</a></h1>
</div>
Run Code Online (Sandbox Code Playgroud)
从逻辑上讲,标签中H1有一个部分名称a.我想从外部包含div中选择所有内容,直到我遇到另一个h1并排除该div.
<a>标签下面,h1该标签有多个孩子(每个约6个)我的尝试:
var startNode = helpDocument.DocumentNode.SelectSingleNode("//h1/a[contains(., '"+sectionName+"')]");
//go up one level from the a node to the h1 element
startNode=startNode.ParentNode;
//get the start index as the index of the div containing the h1 element …Run Code Online (Sandbox Code Playgroud) 我是使用jqgrid的新手.
在新页面加载时,网格正在从数据库中正确加载数据.之后由于loadonce:true,网格没有从数据库重新加载数据以进行添加/编辑/删除.
我的应用程序组合是JSP,Servlet,MySQL
我有一个具有以下设置的网格
jQuery("#userList").jqGrid({
url: '<%=request.getContextPath()%>/userJqGrid?q=1&action=fetchData&userCookie=<%= encodedCookie%>',
datatype: 'xml',
mtype: 'GET',
colNames:['<%= userProp.getProperty(userColNames[0])%>',
'<%= userProp.getProperty(userColNames[1])%>',
'<%= userProp.getProperty(userColNames[2])%>',
'<%= userProp.getProperty(userColNames[3])%>',
'<%= userProp.getProperty(userColNames[4])%>',
'<%= userProp.getProperty(userColNames[5])%>'
],
colModel:[
{name:'<%= userColNames[0]%>',index:'<%= userColNames[0]%>',
width:120,sortable:true,editable:true,editrules:{required:true},formoptions:{rowpos:1, elmprefix:'*'}},
{name:'<%= userColNames[1]%>',index:'<%= userColNames[1]%>',
width:130,sortable:true,editable:true},
{name:'<%= userColNames[2]%>',index:'<%= userColNames[2]%>',
width:100,sortable:true,editable:true,editrules:{required:true},formoptions:{rowpos:3, elmprefix:'*'}},
{name:'<%= userColNames[3]%>',index:'<%= userColNames[3]%>',
width:180,sortable:true,editable:true,editrules:{email:true,required:true},formoptions:{rowpos:4, elmprefix:'*'}},
{name:'<%= userColNames[4]%>',index:'<%= userColNames[4]%>',
width:100,sortable:true,editable:true},
{name:'<%= userColNames[5]%>',index:'<%= userColNames[5]%>',
width:100,sortable:true,editable:true},
],
pager: '#pager1',
rowNum:50,
height:'auto',
//rowList:[10,20,30],
loadonce: true,
sortname:'<%= userColNames[0]%>',
viewrecords: true,
editurl:'<%=request.getContextPath()%>/userJqGrid?q=1&action=addData&userCookie=<%= encodedCookie%>',
caption: 'User Grid',
ondblClickRow: function(rowid) {
$("#userList").jqGrid('editGridRow',rowid, userEditParam);
return;
}
});
$("#userList").jqGrid('navGrid',"#pager1",{add:true,edit:true,del:true});
$("#userList").jqGrid('gridResize', …Run Code Online (Sandbox Code Playgroud) 我正在 Netezza 中进行一些 QA,我需要比较两个单独的 SQL 语句的计数。这是我当前使用的 SQL
SELECT COUNT(*) AS RECORD_COUNT
FROM db..EXT_ACXIOM_WUL_FILE A
LEFT JOIN (select distinct CURRENTLY_OPTED_IN_FL,mid_key from db..F_EMAIL) B
ON A.MID_KEY=B.MID_KEY
MINUS
SELECT COUNT(*)
FROM db..EXT_ACXIOM_WUL_FILE A
Run Code Online (Sandbox Code Playgroud)
然而,看起来 MINUS 并不是这样工作的。当计数匹配时,Record_count 将返回 null,而不是返回 0。我基本上将记录数计算为:
record_count=count1-count2
Run Code Online (Sandbox Code Playgroud)
因此,如果计数相等则为 0,否则为差。正确的 SQL 是什么?