|
Hi,
Am using a File upload tag in a JSP page.
(Input type="file")
After clicking submit(),after usual validation,sometimes user is getting error validation message.at this point of time, the content in the textbox is clearing and system is focusing the the textbox next to browse button.
Here am validatiing the page click with image comparision which is Serverside.
so is there anyway to hold the content(path)in the text box.Have a Nice Day Dudes
|
|
|
|
|
session variable or cookies.
|
|
|
|
|
This is not a Java question (JavaScript != Java), so you may get a better response in the ASP.NET or Web Development forum. Please read the guidelines[^] to make sure you post in the right place. MVP 2010 - are they mad?
|
|
|
|
|
Richard MacCutchan wrote: JavaScript != Java
yet you can use both together.
|
|
|
|
|
4277480 wrote: yet you can use both together.
You can use WPF with VB.NET or C#, but WPF is still not either of those languages.
However, my main point is that this question stands a better chance of an answer in a more appropriate place. I don't think many of the Web developers look at the Java forum.MVP 2010 - are they mad?
|
|
|
|
|
I know what you mean and your absolutely correct, I only wanted to mention it.
|
|
|
|
|
Can someone tell me how this can be done in Java? It's a PERL Web service call in Phyton, there is no WSDL available. Any suggestions will be appreciated.
server = SOAP.SOAPProxy("https://xyz:xyz@soap.abc.com/mod_soap",namespace="somenamespace")
test=('connection_test','')
a=apply(server.dynamic, test)
print a
|
|
|
|
|
|
I have to create a Slot Machine in java for college and am having problems with the last bits of it.
It contains 3 classes, the main slotMachine class(which contains the main logic for the game, calling on the other 2 classes), a Column Class and a slot Class.
here is the code for each:
slotMachine - (Very incomplete - last thing to do!)
import java.io.IOException;
public class slotMachine
{
public static void main(String[] args) throws NumberFormatException, IOException
{
int initialBalance = 10;
Stream in = new Stream(System.in);
System.out.println("*****WELCOME TO MY SLOT MACHINE*****");
System.out.println("Your initial balance is: " + initialBalance + " credits");
System.out.println("Please enter an amount to bet: ");
int betAmount = in.readInt();
}
}
Column -
import java.util.Random;
public class Column
{
int faceInt;
public void newFace()
{
Random newFace = new Random();
faceInt = newFace.nextInt(3);
}
public String toString()
{
switch(faceInt)
{
case 0:
return ("|APPLE|");
case 1:
return ("|ORANGE|");
case 2:
return ("|PEAR|");
}
return null;
}
}
Slot -
public class Slot
{
Column column1, column2, column3;
public Column pullHandle()
{
column1.newFace();
column2.newFace();
column3.newFace();
return column1;
}
public boolean fullHouse()
{
if(column1.equals(column2) && column2.equals(column3))
{
return true;
}
else
{
return false;
}
}
public boolean halfHouse()
{
if(column1.equals(column2) || column2.equals(column3) || column1.equals(column3))
{
return true;
}
else
{
return false;
}
}
}
I am trying to call the pullHandle method (located in the Slot class) in the slotMachine class, but don't know how! When I put Slot.pullHandle(); in the main class, it doesn't work, giving me the error of can't reference a static type, from a non static source (or something like that), so I change it to static, then when I run it I get an error saying:
Exception in thread "main" java.lang.NullPointerException
at Slot.pullHandle(Slot.java:8)
at slotMachine.main(slotMachine.java:18)
Also, in the Slot class, for the pullHandle class I want to return the 3 columns, but keep getting a code unreachable error.
This is stressing me out! Help me please!modified on Monday, February 8, 2010 5:40 PM
|
|
|
|
|
Your pullHandle() method is using the variables column1, 2, 3 but nowhere do you initialize them, hence the NullPointerException. As to the static/nonstatic problem, you need to create instances of all your classes and call methods on those instances.
Try reading through some of these tutorials[^] to get a better grasp of how classes operate.
MVP 2010 - are they mad?
|
|
|
|
|
Did I not initialize them in the collumn class and then call them in the slot class?
|
|
|
|
|
bmnot wrote: Did I not initialize them in the collumn class and then call them in the slot class?
Not that I could see, although it was not easy given that you posted your code in three separate places. Try to post the entire code in your original message (use the edit link), and don't forget to enclose it in <pre></pre> tags (use the "code block" button).
I think in your slot class you have a statement like Column column1, column2, column3; which creates the three variables but does not initialise them to anything.MVP 2010 - are they mad?
|
|
|
|
|
i called a method from a different class on them(.newface), does that not initialise them?
|
|
|
|
|
bmnot wrote: i called a method from a different class on them(.newface), does that not initialise them?
Since I have no idea what that code does, I cannot answer the question. Your comments suggest you need to spend some time rereading your Java manual on classes, objects and their use.MVP 2010 - are they mad?
|
|
|
|
|
no, this does not modify the value as the newFace() method does not return a value and/or modify any given value.
try to set the values like this:
Column column1=0;
Column column2=0;
Column column3=0;
It's alwasy good to not have uninitilzed values, give'em at least some "empty" value.
Also always include getter and (if needed or might be needed in future) setter:
public int getColumn1(){
return column1;
}
public void setColumn1(int _column1){
column1 = _column1;
}
do you know how to debug your code?
greets
TorstenI never finish anyth...
|
|
|
|
|
Hello Friends
I created a 3d viewer.I loaded one object tht is centerd at some other than (0,0,0) but MouseRotate is rotating around only(0,0,0).
Is there any way to change the center of Rotation?
Or any way to change the center of object to worldCordinate(0,0,0)?
Thanks IN Advance.
Regards
Yogesh
|
|
|
|
|
No Body Replied.
But it helps me to find myself.We can do it with OrbitBehaviour class method that is setRotationCenter().
AnyWay,Thanks who viewed my Thread().
But now i am having one more question,if u guys can help me in this.I am having one point3d() that is the center of object.I want to convert it into WorldCordinates.
I read abt getLocaltoVWorld().But it return Transform3d() and I am having my local points in Point3d().Please Advice me Something.
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
yogeshs wrote: No Body Replied.
That suggests to me that nobody knows the answer. You may find that the CodeProject expert on Java3D is someone called Yogesh. MVP 2010 - are they mad?
|
|
|
|
|
|
|
Sorry but the laugh was on Java3D not directed to you at all.
|
|
|
|
|
can u help me out in my another question?
Do u have any Ideas?
|
|
|
|
|
yogeshs wrote: Do u have any Ideas?
None at all, I'm afraid. As I said above, it looks like you are the only person here with any experience of this.MVP 2010 - are they mad?
|
|
|
|
|
Now u r indirectly making joke on me Dear.
I am new to java3d sir ji.I am a c++ programmer,u can see my posts on c++ message Board.
Anyway,thks for ur Help.
Regards
Yogesh
|
|
|
|
|
yogeshs wrote: Now u r indirectly making joke on me Dear.
Not at all, I am being serious. I understand that you are new to Java3D, but as you can see, there is no-one here who has the answer to your questions. As you solve each problem you gain in knowledge so that you now have more knowledge than anyone else who reads this forum.MVP 2010 - are they mad?
|
|
|
|