I'm trying to bind in a third party app to our project but have discovered that the unix paths of their property files have been hard-coded into several classes. It is probably possible to make minimal changes to their setup, so my question is: what are the possible (and quickest) ways to achieve this? The third party app uses neither an...
Hi guys,
I've made a very simple REST controller method with Spring 3.0.0.RC1 that uses hibernate to perform a query. The query takes about ten seconds to complete. I've made this with intent so that I can fire up two requests to my controller.
Then I fire up the two requests, and query in MySQL (my DB backend) "show full processlist",...
I'm working on eclipse and after making some changes in application and redeploying EAR file on OC4J server (i've added ssl support) my application binding in secure-web-site.xml ( i mean: tag) disappears or rather is not adding. What do i have to do to get this done automatically ?
...
I am working on a bug in this program where it should be able to save the contents of a JTextPane to a formatted HTML file. The code that is currently there save a file containing just the tags but no content. The page appears blank but all the correct <p> and <font> tags are there with the correct colour set etc.
HTMLDocument htmlDoc =...
The commons FileUtils look pretty cool, and I can't believe that they cannot be made to append to a file.
File file = new File(path);
FileUtils.writeLines(file, printStats(new DateTime(), headerRequired));
The above just replaces the contents of the file each time, and I would just like to keep tagging this stuff to end just as this c...
Can someone tell me how to configure hibernate (Annotations) with Eclipse?
...
What I have right now
I have a 3rd party singleton instance that my class under test relies on and that singleton is using System.getenv(String) in its constructor. Is it possible to mock this call?
I tried this
JMockIt Example
new Expectations()
{
System mockedSystem;
{
System.getenv( "FISSK_CONF...
I'm designing the security subsystem for a new product. The system requires the following:
Complex user/group/permission model, both service-level and domain-level (ACL)
Administration UI for the above
Rules performed upon user actions (account disable on failed login, password complexity requirements, etc).
Before going ahead and im...
Anybody know if there is an easy way to limit the allowed characters for a JTextArea. I.e. similar to JTextField using MaskFormatter.
Specifically I want to limit the allowed characters for a JTextArea to only uppercase characters and only a very limited set characters like !"#¤%&/()=
...
Send to Email.java
package helper;
//Mail.java - smtp sending starttls (ssl) authentication enabled
//1.Open a new Java class in netbeans (default package of the project) and name it as "Mail.java"
//2.Copy paste the entire code below and save it.
//3.Right click on the file name in the left side panel and click "compile" then click "R...
I am reading the following tutorial
Take the following code example.
import javax.jdo.Transaction;
import ClubMembers; // not shown
// ...
// PersistenceManager pm = ...;
Transaction tx = pm.currentTransaction();
try {
tx.begin();
ClubMembers members = pm.getObjectById(ClubMembers....
Hiya, I'm sort a newbie when it comes to hibernate so I'm going to try to ask my question as clearly as possible. I wanna execute following query as hibernate query .
<sql-query name="updateINFO">
update
info
set
status_id = 2
where
pid = :i
</sql-query>
Now i is a dyn...
i have created a file with printStream object as shown below.
PrintStream outPutOffice = new PrintStream(
new BufferedOutputStream(new FileOutputStream(inDir+"/Office.txt")));
outPutOffice.print(fValue + (findx < agtOffColCount ? "|" : ""));
now i have to read it content and sepeate it tokens with "|" as i have written token with "...
when started, jetty per default loads all directories and war-files in its webapps directory, that i can access via context path (e.g. http:// hostname/app/ to access the project in webapps/app.war).
Now when i open http:// hostname/ i get an 404 error and a list of the available contexts. To avoid that, i placed an index.html in the w...
i have a list 1 column and 100 rows each with a number
the number on each row may not be unique
i need to output the unique list of numbers sorted according to their rank , which is less if the number of its repetitions is more. least ranked number i.e 1 is on the top
now here is how i am planning to solve this problem
first i want to...
For my current application I collect images from different "event
providers" in Spain.
Bitmap bmp=null;
HttpGet httpRequest = new HttpGet(strURL);
long t = System.currentTimeMillis();
HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);
Log.i(TAG, "Image ["+ strURL + "] fetched in [" + (System.currentTimeMi...
I am having a session variable whose value can be changed from java and from Jsp as well. Is it possible to detect when this variable's value is changed?
...
I want to parse a xml file using a SAXParser or XMLReader and verify that the file conforms to a specific xsd file (new File( "example.xsd" )).
It's easy to
do the validation against a xsd file in an extra step using a Validator like in this SO answer.
to validate while parsing by specifying the name of the xsd as "http://apache.org/...
Are all final classes in Java immutable.
String and Integer both are final classes and both are immutable i beleive.
...
Does anybody know any engines for calendar implementation?
For example, which accepts event definition object (it can be iCalendar-style) and current date as input and outputs whether this date matches event definition?
...