Sam Wang

Ranch Hand
+ Follow
since Jul 17, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sam Wang

There are maybe different results in different implements of c. but in the platform of java, i=0 is the only answer.
Anyway, if you find code like this in your project, the author must be a bad guy. He may try to play a trick or want to bury this project!
18 years ago
I have a Encodefilter which runs well on struts + tomcat4.
[Encodefilter]
...
request.setCharacterEncoding(encoding);
response.setContentType(contentType);
...
Now I start a new projection bases on webwork + hibernate + tomcat5.
I use the Encodefilter as a filter to url /*,and write a jsp like this:
[JSP]
<%@page contentType="text/html" %>
<%@page pageEncoding="GBK"%>
...
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=GBK">
...
The page can show chinese and english,but can't pass the chinese request parameter(it show the chinese with "???").
I watch my console,I find before the Encodefilter's doFilter(),the param is
already "???".
I don't know what's wrong.Is webwork or something else?
20 years ago
Client can upload image to the server,and can see the image on the jsp.
In tomcat,I set the path of the image to the sub-dir of the web-root-dir.
In jboss,jboss unpackage the war from the deploy dir to the tmp dir.I
don't know how to set my path of the image.Can somebody help me
20 years ago
Can anybody give me a tip or resources about this problem of xdoclet
20 years ago
I have two entities.They're both use composit pk,and they have
the relation of m:n(use a relation table).How can I write the
xdoclet's meta?
20 years ago
there are some resources about lomboz.
go to google to find them,they are so detail!
20 years ago
tomcat4.1.12
w2k iis5
can anyone give me the compatibled "isapi_redirector.dll" and
"ajp.jar" and "tomcat-util.jar"
21 years ago
[env]
eclipse2.1.1,
xdoclet1.1.2,
jboss3.2.3,
LOMBOZ plugin
21 years ago
I have a b/s project.Now,I must get the MAC/CPU/HD-KEY of the client machine(or anything that verify the only client pc).How???
21 years ago
[source]
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.set(2003,9,5,13,0,0);
System.out.println(calendar.getTime());
System.out.println(Boolean.getBoolean("true"));
[console]
Sun Oct 05 13:00:00 CST 2003
false
[question]
why not:
Fri Sep 05 13:00:00 CST 2003
true
I meet a question with jb9.
When I code in jb8,there's package codeinsight.
When u type java and then type ".",a pop-up
window show some package like util,sql and text.
But I can't find this feature in jb9(or sth
of my pc is wrong?).In the jb9,other codeinsight
are ok(like method and parameter).
Can anybody explain this???
After 3 days,reply cames.First much thank Philip Shanks.
I also use the tomcat-user.xml to manager the user and role through security realm.
I want to know whether there is any better means to implement the user-role in the struts.
21 years ago
I have 100 users along with their roles in database.
I have 100 functions in my web application.(for example,100+ org.apache.struts.action.Action)
The users and their roles often change(after one or two months)
How can I implement this role_based authorization (in struts1.1)?
Also I can extend a base action with authorization or implement the processRoles in the org.apache.struts.action.RequestProcessor,but I don't want to modify my java code or jsp after one or two months.
Please help me!
21 years ago
I create a new struts lib and remove the old one(
if there are two struts frameworks,the web appli-
cation will add two struts-config.xml files,is it
a bug?).Then I modify the dtd of struts-config
.xml.It's ok.
21 years ago
I modify the doctype of the struts-config.xml
(http://jakarta.apache.org/struts/dtds/struts-
config_1_0.dtd - > http://jakarta.apache.org/struts/dtds/struts-
config_1_1.dtd)
If anybody has some better way?
21 years ago