K Sathya Narayanan

Greenhorn
+ Follow
since Feb 15, 2007
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 K Sathya Narayanan

Hi

Thanks for the reply, it is now working correctly

I replaced the struts-core-2.1.2 with core-2.1.6 , added the common-io.jar
and also removed the struts.jar file


Thanks,

Sathya Narayanan K
11 years ago
Hi

i am creating a Jasper Reports.

i am getting a java.lang.NoSuchMethodError: com.opensymphony.xwork2.Action.get(Ljava/lang/String;)Ljava/lang/Object; exception


i am using xworks-2.1.1.jar , Jasperreports2.0.5 , struts2-jasperreports-plugin-2.1.6
Jdk is 6.0(1.6)

I have added the below libs

commons-beanutils-1.8.0.jar
commons-collections.jar
commons-digester-1.7.jar
commons-fileupload-1.2.1.jar
commons-lang-2.1.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
displaytag-1.1.jar
freemarker-2.3.8.jar
iText-2.1.5.jar

jasper.jar
jasperreports-2.0.5.jar

jcommon-1.0.9.jar
jcommon-1.0.9-junit.jar
jcommon-xml-1.0.9.jar
jfreechart-1.0.13-experimental.jar
jfreechart-1.0.13-swt.jar
jfreechart-1.0.13.jar

junit.jar

jxl.jar
ognl-2.6.11.jar
servlet.jar
struts-commons-beanutils.jar
struts.jar
struts2-core-2.1.2.jar
struts2-jasperreports-plugin-2.1.6.jar
xwork-2.1.1.jar

please tell me if any other jar files need to be added

Please help me to solve this issue
Stack Trace



---------------------------------------------------------------------------------------------------------------------------------------------------------

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception


javax.servlet.ServletException: Filter execution threw an exception

root cause

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
Apache Tomcat/6.0.18

---------------------------------------------------------------------------------------------------------------------------------------------------------



Thanks and Reqards

Sathya Narayanan K
11 years ago
Hi

Visit the below website to learn more about BreadCurmb in struts 2.0

http://cwiki.apache.org/S2PLUGINS/breadcrumbs-plugin.html

[url]http://books.google.co.in/books?id=1rbeG3-jdnoC&pg=PA321&lpg=PA321&dq=breadcrumb+support+in+struts2&source=bl&ots=cXm28SBClL&sig=uk18njXRqOppiyYO2TaAxfuDVZc&hl=en&ei=XQKzSqeBE6bq6gOAvpn1CQ&sa=X&oi=book_result&ct=result&resnum=2#v=onepage&q=breadcrumb%20support%20in%20struts2&f=false
[/url]

HTH
Sathya Narayanan K
11 years ago
hi Krishna,

can i register for the scjd part 1 exam with the exisiting voucher

Thanks in Advance
K Sathya Narayanan
Hi

I developing a eclipse plugin . I have a rmi server. i want connet using the below code



I have the defined the service url in context.xml
But i get a NameNotBoundException:dspjmxrmi

When i tried to load the context.xml using the below(my friend suggested me to load context.xml)




I get the exception
java.lang.NoClassDefFoundError: org/springframework/core/io/ClassPathResource
Even though the necessary jar files are in the build path. I get this exception Please tell how to overcome this.

Please suggest me to how to load the context.xml .
Please also suggest me to connect to the JMXConnectorFactory.



context.xml
-------------------------------------------------------------------------------




Thanks in advance
K Sathya Narayanan.
11 years ago
Hi ,
i am developing a Plugin for eclipse 3.4 using SWT. I am adding a page in the eclipse preference. There is table and button in the that Page. On clicking the button a form with some fields need to be displayed as a dialog box. The value in the dialog box must be set in the table. I tried varies ways to display the form but it is not working. When i create a new instance of Display and Shell it results in a Invalid thread Exception. When i use the existing Display and Shell , no exception is raised and also not form is displayed .i have instantiated the Form and FormToolkit objects , but it does not get displayed.
please tell me how to display a form with certain fields like Label , text and Button when a button is clicked. can i use Windows instead of form to get data.

Thanks in Advance
[ September 24, 2008: Message edited by: K Sathya Narayanan ]
12 years ago
hi
i have done scjp 5.0 with 84%. i have brought the sun voucher. please tell me phone number/email address of sun which can be used to register for scjd Assignment part.

Thanks in advance
K Sathya Narayanan
mvc is model view controller

model-represents the data.you can think of this as data base and code which access the database. here mysql and java source which access the mysql becomes the model

view-this represents user intreface, here jsp represents the view.

controller-This mainly deals with business processing. it should be done using a Pogo/servlets but should not be done in jsp. for checking the validity of user , identifying which jsp should be called etc .

MVC is a concept . there are two versions of ,mvc

mvc1 ->all the view,control elements are implemented using Servlets/jsp.
mvc2 -> the view is implemented using JSP,and the controller is implemented using Servlets,as JSP provides better user interface than Servlets.

here MVC deals how the project is organized ,so if you is a project in which all the ui is handled by jsp , other database or other operations like login validation done by servlets/pogo, then it is mvc2. if you see a project in which all the ui and database operation done in jsp , then it is mvc1.

mvc2 is used in IT industry . but when you get more experience in the IT industry mvc will be replaced by design patterns in large projects.

HTH
K Sathya Narayanan
12 years ago
JSP
hi
even you can use
public static void main(){}//complies ok instead of public static void main(String[] args){}

but when you try to execute it will result in a runtime exception.
The complier expects the main() method to have the following attributes
1 must be public and static,the order in which it is typed is not a error

static public void main(String[] args) {}//ok

2. must return void as return type and have a string[] as argument
as of java 5. , you can use main(String...data) instead main(String[] data)

The String[] passed in the main function delas with the command line arguments. so you may overload the main function , but the main function with the above attributes only will be called by the compiler. even if the program may not use the command line arguments but still string[] must be passed as argument.

HTH
K Sathya Narayanan
12 years ago


The above program changes the extension of *.txt to *.xml. if ext file is not found , then it creates a file in that name and renames its extension to xml. files with other extension are not renamed or created.
12 years ago
hi
Both Hashtable and HashMap provides an unordered , unsorted map.

1. if you are not particular in which the elements need to be iterated , then you can use Hashtable or HashMap. but if you want to iterate in particular order and use a Map , then you can go for either LinkedHashMap or TreeMap. LinkedHashMap helps to iterate in the inserted order or access order(last accessed first). The TreeMap helps to iterate in the sorted order.

But Hashtable or HashMap or faster in adding/ removing the elements. But as the elements in TreeMap increases , time taken to add a element in the TreeMap increases. The Iteration of LinkedHashMap is little faster than HashMap.

so if you are not worried in the order in which elements need to be accessed , you can use Hashtable or HashMap.

2. The Hashtable can be used in multi threaded environment which requires that only one thread should access the data. As Hashtable methods are synchronized , it suits the need. If you don't want to allow null values , you can use Hashtable.

But if your project is based on a single threaded model , then you can use HashMap. HashMap also allows one null key and many null values. The methods of HashMap are not synchronized , so it executes faster and not suitable for multi-threaded environment

if require the data to be iterated in a random particular order and needs a Map then you can use HashMap or Hashtable.

Hashtable for multi-threaded application or web-based application and HashMap for Single Threaded Application or desktop application.

HTH
K Sathya Narayanan
12 years ago
hi
As Vector methods are synchronized , there is little more overhead need for thread operation like locking the object and releasing the lock. if a element is to added in Vector v , the current thread must get a lock on the vector v and it must release after adding the value. consider you are doing a single threaded where only one thread will access at a time , adding elements to the vector will bring additional thread- overheads which are not necessary, so ArrayList can be used instead of Vector. But in a multi threaded application , where only one thread need to access your data at a given point of time , you can use Vector

Vector was the oldest Collection. The ArrayList was introduced mainly due to the performance issues faced in using the Vector. Hashtable is the oldest Collection. The Hashtable methods are synchronized and it does not allow null values/keys . HashMap is simmilar to Hashtable , but its methods are not synchronized and it allows one null key and multiple null values.

Both Hashtable and HashMap implments the Map interface.

Both ArrayList and vector Implements List interface.

Another important tip

List , Map and Queue interfaces extend the Collection interface
but Map interface does not extends the Collection interface

HTH
K Sathya Narayanan
12 years ago
hi
i have cleared scjp5.0 with 84%.
please tell me what are the preparations needed to to do the scjd project.
i have little knowledge in rmi ,sockets and swing. please share any info reg scjd certification.

Thanks for your reply
A hashtable-based Map implementation with weak keys. An entry in a WeakHashMap will automatically be removed when its key is no longer in ordinary use. More precisely, the presence of a mapping for a given key will not prevent the key from being discarded by the garbage collector, that is, made finalizable, finalized, and then reclaimed. When a key has been discarded its entry is effectively removed from the map, so this class behaves somewhat differently than other Map implementations.

Both null values and the null key are supported. This class has performance characteristics similar to those of the HashMap class, and has the same efficiency parameters of initial capacity and load factor.

Some Links
http://java.sun.com/j2se/1.4.2/docs/api/java/util/WeakHashMap.html


http://www.onjava.com/pub/a/onjava/2001/07/09/optimization.html
http://www.onjava.com/pub/a/onjava/2001/07/09/optimization.html]

http://www.java-tips.org/java-se-tips/java.util/using-weakhashmap-for-listener-lists.html

HTH
K Sathya Narayanan
[ January 08, 2008: Message edited by: K Sathya Narayanan ]
hi
SCJD:This performance-based certification is for developers interested in demonstrating advanced proficiency in the Java programming language using the Java SE.

SCWCD:This certification is for developers specializing in the application of JavaServer Pages and servlet technologies used to present Web services and dynamic Web content.

http://www.sun.com/training/certification/java/index.xml

if you are a Java Developer you can try SCJD. if you are a JSP/Servlet Developer then you can try SCWCD.

But my suggestion is to try SCJD first as this will help you to master Advanced java, then you can easily master SCWCD.
12 years ago