|
You have not explained how you are writing the file so it is not possible to tell where those characters are coming from. In terms of serialization the sequence is:
1. Read all current objects from the file.
2. Create any new objects, and update the existing ones, as required by the program.
3. Write all updated objects to the new file.
4. End the program.
|
|
|
|
|
Example:
Could you tell me how you would do it? I could then come up with a way that I would do it based on that. An example would help a great deal.
|
|
|
|
|
Just like I told you in my previous message, using the links I gave you in my first message.
|
|
|
|
|
Hi Sir,
I have gone through the above mentioned article and it was good. But I'm confused using the tool.I have done the same as what you have said in the article, but when I run the tool it is always showing NullPointerException. Even I have tried with TestPage.jsp from example, but still it is showing the same NullpointException.I have posted the error below.
Thanks in advance,
Nick.
INFO: Validating file /WEB-INF/TestPage.jsp
Exception in thread "main" java.lang.NullPointerException
at org.apache.jasper.compiler.NodeVisitor.visit(NodeVisitor.java:85)
at org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:958)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
at org.apache.jasper.compiler.JSPValidator.doValidate(JSPValidator.java:325)
at org.apache.jasper.compiler.JSPValidator.validatePages(JSPValidator.java:126)
at org.apache.jasper.compiler.JSPValidator.main(JSPValidator.java:368)
|
|
|
|
|
Please post your question in the forum at the end of the article so the author gets notified. There are thousands of members online at CodeProject, so you need to direct it to the right person.
|
|
|
|
|
Dear Friend,
I build the dll(Maths) in visual studio 2013 win32.
Hide Copy Code
#include "stdafx.h"
#include <stdio.h>
extern "C"
{
__declspec(dllexport) int Add(int x, int y)
{
return x+y;
}
}
and tried to call this dll in java using JNA library.
Hide Copy Code
import com.sun.jna.Native;
import libs.IMathFunc;
public class MathFuc {
public static void main(String[] args) {
// TODO Auto-generated method stub
IMathFunc mathfunc = (IMathFunc)Native.loadLibrary("Maths", IMathFunc.class);
int addition = mathfunc.Add(5, 5);
System.out.print(Integer.toString(addition));
}
}
But I dont knwon where I am making mistake
Can anyone refer me an atricle or sample application on this issue.
Please kindly help me on this issue.
Thanks,
S Shanmuga Raja
What I have tried:
I have used JNA library. But it throwing error like:
Hide Copy Code
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'Maths': JNA native support (win32-amd64/Maths.dll) not found in resource path (E:\Maths\Demo\bin;C:\Program Files\JAVA\jna-3.5.2.jar\jna-3.5.2.jar;E:\MathsDemo\x64\Debug;C:\Program Files\JAVA\jdk1.8.0_71\include\win32)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:220)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:322)
at com.sun.jna.Library$Handler.<init>(Library.java:142)
at com.sun.jna.Native.loadLibrary(Native.java:387)
at com.sun.jna.Native.loadLibrary(Native.java:366)
at MathFuc.main(MathFuc.java:13)
|
|
|
|
|
The message is quite clear, it cannot find the dll file.
|
|
|
|
|
I have pasted the dll in appropriate location.But still I am facing same error.
|
|
|
|
|
Well it is fairly obvious that the Java runtime cannot find it. Try putting it in the same directory as your Java application, or adding the path to the java.library.path property.
|
|
|
|
|
please am new in java programming and i have a problem on how to solve the problem below please can any one help me.
how to write a java program to display 3 on labal1 if textbox1 is not empty or display 0 if textbox1 is empty
|
|
|
|
|
|
if we take input as 'eyes'
then, occurence of e = 2
y = 1
s = 1
then, 2=1+1 ,so the output will be 'YES'
if its not equal ,then output will be 'NO'
that is, check whether the sum of occurences of some character is equal to the sum of occurences of other charcters.
|
|
|
|
|
Very interesting. Now do you have a question?
|
|
|
|
|
yeah, this is my question
if we take input as eyes
then, occurence of e = 2
y = 1
s = 1
then, 2=1+1 ,so the output will be printed like "YES"
if its not equal ,then output will be printed "NO"
that is, check whether the sum of occurences of some character is equal to the sum of occurences of other charcters.
|
|
|
|
|
Jebastin koilraj wrote: yeah, this is my question
No, it is your homework assignment. It is not a question.
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
You need to loop through each character and if it is the one you want, increment counter A and if it is not the character you are interested in increment counter B. Then compare the counters. Simple.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
thank you 
|
|
|
|
|
|
Not sure what you think FTP and chat applications have to do with each other but,
file upload using FTP[^]
or
file download using FTP[^]
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
hey thanx for reply ..this application allow a client and a server to send message to each other..i am asking how to implement if client/server wants to send file through this application .
|
|
|
|
|
Member 12814174 wrote: wants to send file through this application
Then why didn't you ask about that?
Google[^]
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
FTP is a protocol and has nothing to do with GUI design or programming. If you want to add it into your application then you need to create the protocol rules that your client and server will follow. At its most basic it will be something like:
User selects a file and clicks the UPLOAD button.
Client system sends an FTPstart message to the server.
Server sends an acknowledge/ready message back to the client.
Client sends the next N bytes of the file.
Server responds with ACK.
... repeat until ...
Client sends NoMoreData message.
Server responds with some message to show all the data has been received and saved.
|
|
|
|
|
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Demoswing extends JFrame implements ActionListener
{
JPanel p1;
JTextField txt;
JButton bt1,bt2,bt3;
JLabel l1;
JLabel l2;
JPasswordField pf;
Demoswing()
{
l1 = new JLabel("UserName");
txt= new JTextField(10);
l2 = new JLabel("Password");
pf = new JPasswordField(10);
bt1 = new JButton("Login");
bt2 = new JButton("Cancel");
bt3 = new JButton("Exit");
p1 = new JPanel();
p1.setLayout(null);
l1.setBounds(70,100,100,25);
txt.setBounds(200,100,100,25);
l2.setBounds(70,150,100,25);
pf.setBounds(200,150,100,25);
bt1.setBounds(60,200,100,25);
bt2.setBounds(190,200,100,25);
bt3.setBounds(310,200,80,25);
p1.add(l1);
p1.add(txt);
p1.add(l2);
p1.add(pf);
p1.add(bt1);
p1.add(bt2);
p1.add(bt3);
add(p1);
bt1.addActionListener(this);
bt2.addActionListener(this);
bt3.addActionListener(this);
setVisible(true);
setSize(500,500);
setTitle("Layout frame");
setResizable(false);
setLocation(100,50);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==bt1)
{
String user = txt.getText();//to get username textfield detail
String pwd = pf.getText();//to get passwordfield detail
if(user.equals("appin")&&pwd.equals("123"))
JOptionPane.showMessageDialog(null,"valid user","Authentication",1);//to get dialog box when both the fields are same
else
JOptionPane.showMessageDialog(this,"invalid user","error",0);
}
else if(ae.getSource()==bt2)
{
pf.setText("");
txt.setText("");
}
else
{
System.exit(0);
}
}
public static void main(String arg[])
{
Demoswing ob = new Demoswing();
}
}
|
|
|
|
|
|
One of these days, you might learn that an unformatted code-dump is not a good question.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|