我正在尝试学习struts2,所以这是一个非常基本的问题.
我有一个页面input_database.jsp,以及它对应的类input_database.java
在类文件中,我有一个带有mutator和accessor的字符串的arraylist.我想在我的.jsp文件中显示它
我一直试图用a来做,但我认为我做的事情从根本上是错误的.
这是我一直试图在jsp文件中使用的代码.arraylist是一个名为query_data的私有字符串列表.我的最终目标是显示一个字符串arraylists的arraylist来显示我的select语句,但我需要先找出一些简单的字符串.如果有人知道我做错了什么,或者可以指出一个我忽略的教程,那就太棒了
谢谢
<s:iterator value="query_data" id="something">
<s:property value="something"/><br />
</s:iterator>
Run Code Online (Sandbox Code Playgroud) 我有一个memomry泄漏问题,也许有人可以帮助我.我尝试为pList加载NSMutable数组并在TablevView中显示一些元素
在h.File我宣布
@interface Bestellung : UIViewController <UITableViewDelegate, UITableViewDelegate> {
NSMutableArray *bestellteVorspeisen;
NSMutableArray *bestellteVorspeisenPreis;
NSMutableArray *bestellteVorspeisenDetails;
NSMutableArray *bestellteVorspeisenBild;
NSMutableArray *bestellteVorspeisenNummer;
NSMutableArray *bestellListe;
IBOutlet UITableView *myTable;
}
@property (nonatomic, retain) NSMutableArray *bestellListe;
@property (nonatomic,retain) NSMutableArray *bestellteVorspeisen;
@property (nonatomic,retain) NSMutableArray *bestellteVorspeisenPreis;
@property (nonatomic,retain) NSMutableArray *bestellteVorspeisenDetails;
@property (nonatomic,retain) NSMutableArray *bestellteVorspeisenBild;
@property (nonatomic,retain) NSMutableArray *bestellteVorspeisenNummer;
@end
Run Code Online (Sandbox Code Playgroud)
在M.File viewDidLoad中,我在bestellListe中加载了pList
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"Bestellung.plist"];
success = [fileManager fileExistsAtPath:filePath];
if (!success) …Run Code Online (Sandbox Code Playgroud) 我知道这个问题已经在这里提出了好几次.但是我找不到任何有用的解决方案,所以我决定再次发布.
我正在使用Hibernate和Spring MVC框架,我正在尝试获取我的类和子类:
public class Scene implements Serializable{
private Long id;
private Author author;
//omitting getters and setters
}
public class Author{
private Long id;
Private String name;
//omitting getters and setters
}
Run Code Online (Sandbox Code Playgroud)
我的Hibernate配置如下:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.postgresql.Driver" />
<property name="url" value="jdbc:postgresql://127.0.0.1/doolloop2" />
<property name="username" value="doolloop2" />
<property name="password" value="doolloop" />
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingLocations">
<list>
<value>WEB-INF/mapping/Scene.hbm.xml</value>
<value>WEB-INF/mapping/Author.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop> …Run Code Online (Sandbox Code Playgroud) 我正在使用Emacs并尝试尽可能自动化我的单元测试工作流程.我已将其设置为正常工作但我必须在Erlang Shell识别我的更改之前手动编译我的测试模块或包含测试的模块.
我有两个文件mymodule.erl和mymodule_tests.erl.我希望能做的是:
eunit:test(mymodule)或mymodule_tests:test()我已经尝试编写自己的测试方法,但它不起作用.
-module (mytests).
-export([test/0]).
-import(mymodule).
-import(mymodule_tests).
-import(code).
test() ->
code:purge(mymodule),
code:delete(mymodule),
code:load_file(mymodule),
code:purge(mymodule_tests),
code:delete(mymodule_tests),
code:load_file(mymodule_tests),
mymodule_tests:test().
Run Code Online (Sandbox Code Playgroud)
我还尝试通过放入-compile(mymodule).mymodule_tests来查看我是否可以在更新mymodule_tests时自动重新加载mymodule,但无济于事.
我也搜索了相当多,但找不到任何相关信息.因为我是Erlang的新手,所以我想我正在寻找错误的术语,例如erlang reload module,或者在编译另一个模块时你不应该重新加载其他模块.
我正在读一本关于C#(Pro C#和Andrew Troelsen的.NET 4平台)的书,我刚读过这段话:
如果要构建将部署到低内存设备(例如支持.NET的手机或PDA)并且需要尽可能节省内存的.NET应用程序,则更改枚举的基础类型会很有帮助.
字节使用更少的内存是真的吗?出于性能原因,它们不是存储在4个字节上吗?我记得在某个地方读过后者,但我找不到任何关于它的信息,甚至在C#规范中都没有.
假设我在Reporting Services模板中有一个带日期值的字段,例如=CDate("2010.12.03"),我将"d"格式应用于此单元格,根据描述,"将反映报告的区域设置".我使用英语生成报告,日期显示为12/03/2010,这很好.现在,当我出口这份报告到Excel,我不知道是什么_ _发生.
第一种情况:计算机的区域设置设置为英语(美国).当我打开excel文档时,单元格中看到的值12/03/2010正如预期的那样.当我点击它时,我可以看到存储在单元格中的实际值2010.12.03,这似乎也是合理的 - 一些格式应用于单元格,它不是简单地导出为文本.但是当我试图弄清楚应用了什么类型的格式时,通过右键单击并检查格式单元格,我看到格式是"常规",即没有!怎么会这样 ?顺便说一下,这是Excel 2010,但文件本身当然是.xls.
第二种情况,它变得更有趣:现在计算机的区域设置为例如日期格式的立陶宛2010.12.03.我打开同一份文件看看12.03.2010.现在这根本没有任何意义.导出很多次,我遇到过,有时单元格格式化为[$-10409]m.d.yyyyexcel 格式(在"自定义"部分下).这是什么,10409是什么意思?最奇怪的部分:如果我不保存关闭文档,将计算机区域更改回英语(美国),重新打开文档,格式现在就是[$-10409]m/d/yyyy!这怎么可能 !??
基本上同样的事情发生在数字和千位/小数分隔符上 - excel使用计算机的区域来格式化这些,但是单元格的实际格式可能类似于[$-10409]#,##0.00;-#,##0.00或一般 - 再次,取决于计算机的区域,方向风和外面的温度.
那么我的问题是,首先,_ _正在发生什么?第二,excel文档应该如何根据规范行事,即在BIDS设计的格式"将反映报告的区域设置"的声明是什么,我选择日期文本框的"d"格式,意味着什么?这是否意味着,格式将由报告的语言决定,结果在世界上所有计算机上看起来都是一样的(这是有道理的,因为这是其他格式的行为,即如果您将日期导出到pdf,它始终保持不变)?如果不是,这在excel中似乎是部分情况,为什么导出的日期单元格不具有区域日期格式,即您通常在excel中使用的日期格式,
这些是excel的某种局限还是什么?为什么我们不能有一致的行为,即要么使一切都对查看文档的计算机文化敏感,要么不这样做,为什么实际行为介于两者之间?
在我的ant构建文件中,我有一个包含该版本的属性"Version".防爆.2.5.17.230
现在,我使用propertyregexant-contrib来取代所有'.' (点)带下划线的字符.我写的声明如下:
<propertyregex property="Version" input="${Version}" regexp="." replace="_" global="true" />
但是,它不起作用.我甚至徒劳地试过这些:
regexp="\."和regexp="[.]"
有人可以帮忙吗?
谢谢
今天我遇到了PrimeFaces FileUpload的问题.它运行良好,但文件存储在JBoss的临时目录中,所以每当我重新部署应用程序或只是将源提交到svn时,我上传的所有图像都消失了.所以我想问一下,是否有办法将图像保存到战争项目的"源"目录中.
我的handleFileUpload方法:
public String getUrlBase() {
return FacesContext.getCurrentInstance().getExternalContext().getRealPath("//upload");
}
public void handleFileUpload(FileUploadEvent event) {
new File(getUrlBase() + "/" + album.getId()).mkdirs();
File result = new File(getUrlBase() + "/" + album.getId() + "/" + event.getFile().getFileName());
try {
FileOutputStream fileOutputStream = new FileOutputStream(result);
byte[] buffer = new byte[BUFFER_SIZE];
int bulk;
InputStream inputStream = event.getFile().getInputstream();
while (true) {
bulk = inputStream.read(buffer);
if (bulk < 0) {
break;
}
fileOutputStream.write(buffer, 0, bulk);
fileOutputStream.flush();
}
fileOutputStream.close();
inputStream.close();
FacesMessage msg = new FacesMessage("Succesful",
event.getFile().getFileName() + " …Run Code Online (Sandbox Code Playgroud) 我写的过滤器抛出了ClassCastException
[Ljava.security.cert.X509Certificate; 无法转换为java.security.cert.X509Certificate
当我试图转换从ServletRequest属性中提取的Object时,即
public void doFilter(ServletRequest req, ServletResponse res, FilterChain filterChain) throws
IOException, ServletException
{
X509Certificate cert = (X509Certificate) req.getAttribute("javax.servlet.request.X509Certificate");
System.out.println("cert dn " + cert.getSubjectDN().toString());
filterChain.doFilter(req, res);
}
Run Code Online (Sandbox Code Playgroud)
当我深入挖掘时,我理解像这样的异常很可能是由不同的类加载器引起的,尽管它们属于同一类类型.我该如何解决这个问题?
谢谢
我使用以下Spring 3配置来加载Jetty 7零碎
<bean class="org.eclipse.jetty.server.Server"
init-method="start" destroy-method="stop">
<property name="connectors">
<list>
<bean id="SSLConnector" class="org.eclipse.jetty.server.ssl.SslSocketConnector">
<property name="port" value="8553"/>
<property name="maxIdleTime" value="3600000"/>
<property name="soLingerTime" value="-1"/>
<property name="needClientAuth" value="true"/>
<property name="sslContext">
<ref bean="sslContext"/>
</property>
</bean>
</list>
</property>
<property name="handler">
<bean name="contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection">
<property name="handlers">
<list>
<bean class="org.eclipse.jetty.servlet.ServletContextHandler">
<property name="contextPath">
<value>/caas</value>
</property>
<property name="resourceBase" …Run Code Online (Sandbox Code Playgroud) 你如何在Clojure中创建一个可调用的类型或对象?
例如,我如何定义一个记录Foo,该记录采用:bar可以调用以打印该值的单个值?
user=> (def foo (Foo. "Hello world"))
user=> (foo)
Hello World
user=> (:bar foo)
"Hello World"
Run Code Online (Sandbox Code Playgroud) java ×2
ant ×1
ant-contrib ×1
byte ×1
c# ×1
callable ×1
classloader ×1
clojure ×1
cocoa ×1
emacs ×1
erlang ×1
file-upload ×1
hibernate ×1
java-ee ×1
lazy-loading ×1
memory ×1
memory-leaks ×1
nsdictionary ×1
objective-c ×1
primefaces ×1
spring-mvc ×1
ssrs-2008 ×1
struts ×1
struts2 ×1
transactions ×1
unit-testing ×1