Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

Richa Anand

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

Recent posts by Richa Anand

Hello All,
I have a very simple app. I just wanna display an JPEG on a frame. I have configured Apache Tomcat and created JNLP file. Everything is working just fine except that the image is not being displayed.

Code Snippet
------------
class MyFrame extends JFrame{
MyFrame(String title){
super(title);
MyDrawPanel drawPanel=new MyDrawPanel();

addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent we){
setVisible(false);
dispose();
System.exit(0);
}
}
);
}
public void paint(Graphics g){
g.drawString("App Home",20,50);

Image img=Toolkit.getDefaultToolkit().getImage("logo.jpg");
g.drawImage(img,20,80,this);


}
}

public class AppHome{
public static void main(String args[]){
MyFrame fr=new MyFrame("title");
fr.setSize(200,300);
fr.setVisible(true);
}
}
I'm creating the JAR file like this:
jar -cvf Home.jar logo.jpg *.class

Anybody pls help, how do I go abt that?

Rgds,
Richa
16 years ago
Hello All,
I wanna display an image in a Frame window. Do do I go abt doing that.

Rgds,
Richa
16 years ago
Hello All,
I bought a SCWCD certification voucher in India. But it is for Java EE 1.4 spec. When can we expect Java EE 1.5 spec?
Would it be worthwhile to go for the 1.4 cert?

Rgds,
Richa
I found this to be an interesting discussion.

Well, I believe that Spring proposes a paradigm wherein we use POJOs instead of EJBs. That is, what we used to previously do through EJBs, we would be doing away with POJOs. It has been seen that many projects which don�t require remote/distributed computing, still make heavy use of EJBs, which is bad. So, directly, Spring targets the EJB technology. And, since we don�t need EJBs, we don�t also need an app server right?
So why can�t we compare Spring (okay I agree Spring is not a containet but an app framework) with a high end app server like Weblogic/Websphere?

Regards,
Richa Anand
Hello All,
I�m new to spring and DI pattern. I have taken all the required steps like created a development environment similar to Spring sample applications.
For instance,
D:\spring-framework-1.2\samples\BikeRental\src is the directory where I have kept all the source code files.
Similarly,
war\classes
war\WEB-INF\RentABikeApp-context.xml Spring Configuration file
war\WEB-INF\lib directory where I have copied the Spring JAR files

My �src� directory has the following files
1.Bike.java � a simple POJO
2.RentABike.java � interface/service
3.ArryListRentABike.java � implementation class
4.CommandLineView.java � my client class
5.RentABikeAssembler.java � this is the third party code

What I�m trying to do here is to inject dependencies through Spring third party code.
Below is the code for the Spring assembler

import org.springframework.context.support.ClassPathXmlApplicationContext;
public class RentABikeAssembler {
public static final void main(String[] args) {
ClassPathXmlApplicationContext ctx = new
ClassPathXmlApplicationContext("RentABikeApp-context.xml");
CommandLineView clv =
(CommandLineView)ctx.getBean("commandLineView");
clv.printAllBikes( );
}

And, my Spring configuration files goes like this:
D:\spring-framework-1.2\samples\BikeRental\war\WEB-INF\RentABikeApp-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/
dtd/spring-beans.dtd">
<beans>
<bean id="rentaBike" class="ArrayListRentABike">
<property name="storeName"><value>"Bruce's Bikes"</value></property>
</bean>
<bean id="commandLineView" class="CommandLineView">
<property name="rentaBike"><ref bean="rentaBike"/></property>
</bean>
</beans>


But, when I run the assembler i get the following runtime exception:
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStore
Exception: IOException parsing XML document from class path resource [RentABikeA
pp-context.xml]; nested exception is java.io.FileNotFoundException: class path r
esource [RentABikeApp-context.xml] cannot be opened because it does not exist
.....


Can anybody help.
Regards,
Richa
SCJP
Hello All,
I'm using Apache Tomcat 5. I want to write an application build around JWS.

I want to configure the servlet container to use the appropriate MIME type. The server must return the application/x-java-jnlp-file MIME type for JNLP files in order for Java Web Start to invoke.

How can I do that?
Regards,
Richa
16 years ago