|
be able to force the eclipse browser window to a specific page every time.
set web.xml like
<web-app>
...
<welcome-file-list>
<welcome-file>yourPage.html</welcome-file>
<welcome-file>yourPage.jsp</welcome-file>
<welcome-file>yourPage.htm</welcome-file>
</welcome-file-list>
</web-app>
|
|
|
|
|
Thanks so much for your reply.
However I need the browser for eclipse to go to the http://localhost:8080/RestExample/helloworld url. That is I was looking for a way to force browser to append "/helloworld" to the end of the path.
When I adapt the above to;
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>RestExample</display-name>
<welcome-file-list>
<welcome-file>helloworld/index.html</welcome-file>
<welcome-file>helloworld/index.htm</welcome-file>
<welcome-file>helloworld/index.jsp</welcome-file>
<welcome-file>helloworld/default.html</welcome-file>
<welcome-file>helloworld/default.htm</welcome-file>
<welcome-file>helloworld/default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>JerseyTest</servlet-name>
<servlet-class>
com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JerseyTest</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
It makes no difference.
Thanks.
|
|
|
|
|
I see,you develop a JAX-RS using jersey.
you miss a piece of code.
For example
="1.0"="UTF-8"
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<display-name>JAX-RS REST Servlet</display-name>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<servlet-class>
com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>services</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
This project Integrated Spring.
browser for eclipse to go to the http://localhost:8080/RestExample/services/helloworld url
|
|
|
|
|
Error:
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
My COde:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.sql.*;
import sun.jdbc.odbc.*;
/*
<applet code="register" width=250 height=200>
</applet>
*/
public class register extends Applet implements ActionListener,ItemListener
{
Label l1,l2,l3,l4;
TextField t1,t2,t3,t4;
Button submit;
public void init()
{
l1=new Label("RegNo.:");
l2=new Label("Name.:");
l3=new Label("Course.:");
l4=new Label("year.:");
t1=new TextField("regno");
t2=new TextField("name");
t3=new TextField("course");
t4=new TextField("year");
submit=new Button("submit");
add(l1);
add(t1);
add(l2);
add(t2);
add(l3);
add(t3);
add(l4);
add(t4);
add(submit);
t1.addActionListener(this);
t2.addActionListener(this);
t3.addActionListener(this);
t4.addActionListener(this);
submit.addActionListener(this);
}
public void itemStateChanged(ItemEvent ie)
{
repaint();
}
public void actionPerformed(ActionEvent ae)
{
repaint();
}
public void paint(Graphics g)
{
Connection c=null;
Statement s=null;
String a,b,d,h;
a=t1.getText();
b=t2.getText();
d=t3.getText();
h=t4.getText();
g.drawString("Reg.no.:"+a,6,100);
g.drawString("Name.:"+b,6,120);
g.drawString("Course.:"+d,6,140);
g.drawString("year.:"+h,6,160);
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //Driver to connect the ODBC JDBC Bridge
c=DriverManager.getConnection("jdbc:odbc:da","system","manager"); //Connect the Data Source Name
s=c.createStatement();
System.out.println("Database Created");
int count=s.executeUpdate("insert into Table1(regno,name,course,year) values('"+a+"','"+b+"','"+d+"','"+h+"')");
//g.drawString("Record Added");
if(count==1)
g.drawString("Record Added",6,180);
}
catch (Exception e)
{
System.out.println(e);
}
}
}
|
|
|
|
|
What line is throwing the exception? I am guessing that either the driver or the database file is not available.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
No Database file and Driver Are Already Placed and Done All Thing's Perfectly Iam Sure
|
|
|
|
|
Prabakaran1993 wrote: All Thing's Perfectly Iam Sure
Then presumably you already know the answer to your question.
|
|
|
|
|
Based on your other reply you presumably already know all of the following so this is only in case someone else needs to understand it.
MS Access if a file system based database. That means that the database file must be accessible on the client machine for it to work.
That makes it very ill suited for anything related to internet/network work - such as using in in an applet. Additionally it might be less that well suited for multi-user use which also eliminates browser solutions (which are typically only useful for multi-user situations.)
As for the access problem - that couldn't be clearer - it is a access problem. Such problems can arise in any number of ways and the solution is always the same. And googling will find the same solutions which is normally one of the following.
1. Modify the access rights on the client machine to allow it. It is NOT possible to do this in the browser via java.
2. Sign the jar that has the applet in it.
|
|
|
|
|
Sir,As Per Your Concern I Tried But in so many post"
by using applet in html via some signature we can access"
|
|
|
|
|
im trying to display result from my sql statement. here my report looks like
success = 12
fail = 7
how can i display all success data when i click success and all fail data when i click fail link..
any idea..? im using jsp and java class ...
modified 24-Oct-12 5:17am.
|
|
|
|
|
I suspect that you are using Java rather than Netbeans, but your question makes no sense. You display things in Java by using some code, using either swing commands or System.out.print() .
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
thank you for reply back..yes im using java. jsp as my front page and java as class...
|
|
|
|
|
Then please edit your original question and explain what part of your code is not working.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
When I suggested that you put some more detail into your question I meant more than just changing the word "Netbeans" to "jsp and java class". This question gives no idea what you are trying to do, where these values come, from or where you are trying to display them.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
thanks. but it solved already...
|
|
|
|
|
Hi family, i want to make project game by java, can you introduce me!, and what are the documents necessarily for GAME-java?, thanks you
|
|
|
|
|
my long lost brother!
What kind of "game" do you want to create?
I suggest to make up some requirements. Write them down.
|
|
|
|
|
You can look through all the samples here[^], or for a specific sample see Sudoku Game in Java[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
The first and easiest game i've developed without any logic is..
Catch The Rat!
|
|
|
|
|
Hello,
I looking to develop a cloud storage service, and I need help on how to approach this, I already have setup apache tomcat and cxf acting as servers. I need to develop a service similar to amazon s3, where client's files are backed up on the servers.
The files are also need to be in sync with the servers and there is a clusters of servers and each need to have their own files in sync. I need to develop the server side web service and then a client to access these services, I'm quite new to web services, and need some tips on where to start and start developing these in java.
regards
|
|
|
|
|
I'm quite new to web services, and need some tips on where to start and start developing these in java.
Tip: start with a project that you can handle.
Bonus: Start with a project, which you've got the hardware for.
I doubt that you, as a beginner, are in charge of a multi server cluster system.
|
|
|
|
|
I done some research into using Restful web services and developing and I'm using tomcat to create cluster of servers, I was wondering how can I include a database on each server which are also in sync with the other servers, I have research into amazon s3 and they use NoSQL, I need to get somthing like this to work on each server containing user login, and other information such as files(files they uploaded) metadata. this is part of my uni work
|
|
|
|
|
Your post is very confusing.
I suspect because you are not only new to web services but also everything associated with server processing.
I suggest that you FIRST do research about what technologies and architectures are involved in and used with business servers. Do not attempt make any decisions about technologies until you have a better understanding of the different stategies for implementing things.
Then SECOND you make a decision about architecture and decision based on the needs of the business. Naturally if you do not understand the needs of the business then you will need to learn that first.
|
|
|
|
|
Hello,
i wan't access my webcam in JAVA SWINGS how to access. its possile or
not in JAVA...
|
|
|
|
|
Well, it is quite possible but you need to do a bit of research first: something like this[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|