Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Gamini Sirisena

Ranch Hand
+ Follow
since Aug 05, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gamini Sirisena

Can you think how you could do this in non programming talk?

Then you could ask how can I do this or that specific thing.. This way it would be a very getting hands dirty and an enlightening and really enriching experience...
5 years ago
Could be you are missing <mvc:annotation-driven /> in your dispatcher-servlet.xml

you will also need to define the namespace for it.. in the beans tag as..



in your schemaLocation ...

5 years ago
See if this approach might help you..

Consider using a Continous Integration (CI) environment with jenkins combined with your scm and a nexus repository so that jenkins will publish build artifacts in to nexus. When you do a maven build maven should download and cache your dependencies e.g. sales-core etc. and in subsequent builds the build will use the downloaded artifacts now in your local repository. You can use the maven release plugin through jenkings to manage your release procedure. On committs to scm or releasing there would be a new download during a local build but this should be a one time activity for a given commit or release. Hope this helps..
5 years ago
I assume that jdbc here is your NamedParameterJdbcTemplate instance.

I think the String sql is not going to change.. I believe that spring will create it's query with values bounded internally..

did you check the db whether your record was deleted?
5 years ago
array[i] = 4; will work here.

.nextInt() returns and int, not array of int.

Hope you got it.
5 years ago
How about junit?

You could either write test methods combining put, remove etc. with a get
OR you could use Mockito WhiteBox class to get at your HashEntry[] table; to test the behaviour of a method
5 years ago
You never started the other two threads before sleeping..
Shouldn't your produceJSON method return type of Response as in the other method?
5 years ago
Here is an approach that you can try..

create an xml schema to represent your computer parts

use jaxb compiler, xjc to generate jaxb annotated java bindings for this schema (java classes)

when you want to save have the toplevel java class populated with values and marshall it using jaxb.
To do this..
create a javax.xml.bind.JAXBContext.
and do
and call .marshall() on the marshaller obtained.
to the .marshall() method you pass a JAXBElement<SomeClassGeneratedByJaxB>
and SomeClassGeneratedByJaxB will be an ojbect already populated by your program through the GUI

when you want to load use a persisted xml file and unmarshal it using jaxb
Like this..
you do a .createUnmarhaller()
and call .unmarshall()
to the .unmarshall() you pass your xml file in some form (look up the api)
cast result from calling .unmarshall() to a JAXBElement<SomeClassGeneratedByJaxB>
then call jaxbElement.getValue() to get your SomeClassGeneratedByJaxB
5 years ago
because 1.0 is considered a double literal

If you want it to be of type float try 1.0F
5 years ago
with this

you are dereferencing g the object returned from the result set. Which would throw a null pointer Exception if it was null. I sugget you do.. for now.. which will handle the nulls.. (but will print null)


and aren't you seeing a null pointer stack trace in the console?
5 years ago
You want to display results from your database query right?

Now the way you printed the "Hello" you can print each value to the browser.
If you want to display the data in a HTML table then you have to write that to the browser as wel..


5 years ago
Let's take this step by step..

You are doing this..

RequestDispatcher view = req.getRequestDispatcher("Fetch.jsp");
view.forward(req, resp);

comment those lines for now. Browse the web to find how to print stuff to the browser from your servlet. Once you are successful with printing a test message you can try printing all results from your query to the browser.
we'll talk after that..
5 years ago
The class should be fully qualified.. like this..

5 years ago