How to include java source files in the war file using maven2?

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-war-plugin</artifactId>
	<version>2.1</version>
	<configuration>
		<webResources>
			<resource>
				<directory>src/main/java</directory>
				<targetPath>WEB-INF/classes</targetPath>
				<includes>
					<include>**/*.java</include>
				</includes>
			</resource>
			<resource>
				<directory>src/test/java</directory>
				<targetPath>WEB-INF/classes</targetPath>
				<includes>
					<include>**/*.java</include>
				</includes>
				</resource>
		</webResources>
	</configuration>
</plugin>

Posted in Maven | Leave a comment

Hot deployment in tomcat

1. Add tomcat server to eclipse.
2. If you want to start tomcat from eclipse, modify server.xml inside Servers folder in the project explorer.
3. If you want to run tomcat from command line, modify tomcatDir/conf/server.xml file.
4. add this line as a child line inside Server/Service/Engine/Host tag.

<Context path="/ic" 
        reloadable="true"  
        docBase="exploded_war_file_dir"  
        workDir="any_dir_you_like"> 
Posted in tomcat | Leave a comment

Compile Your Application to be JDK 1.4, 1.5 or 1.6 Compatible

maven-compile-your-application-to-be-14-15-or-16-compatible

Posted in Maven | Leave a comment

struts2-junit-plugin 2.1.8 with dependencies

Uploading screenshots of the dependent libraries we need to use the struts2-junit-plugin2.1.8 and need to write struts spring test cases, running all the struts2 interceptors.

no_library

lib_after_struts_core_2.1.8

lib_after_servlet_jsp_jar

lib_after_struts_spring_plugin

lib_after_struts_junit_plugin

web_xml

struts_xml

applicationContext.xml

final_with_test_case

Posted in junit, Spring Framework, struts2 | Leave a comment

Miscellaneous

  • Unlike the DML DELETE statement, the TRUNCATE command
    can’t be reversed by a ROLLBACK command. You can use the new
    flashback to undo the change
Posted in Database, Oracle | Leave a comment

Database Trigger Architecture

  • Database triggers implement an object-oriented observer pattern,
    which means they listen for an event and then take action.
  • A trigger name must be unique among triggers
    but can duplicate the name of any other object in a schema
    because triggers have their own namespace.
  • A namespace is a unique list of identifiers
    maintained in the database catalog.
  • recompile triggers:
    ALTER TRIGGER trigger_name COMPILE;
  • Triggering events communicate directly with the trigger.
    You have no control over or visibility into how that communication occurs.
    You have no data other than that which is available through
    the system-defined event attributes.
  • But, you have access to the new and old pseudo-record types in row-level DML
    and INSTEAD OF triggers. The trigger declaration inherits the declaration
    of these values from the DML statement that fires it.
  • DML row-level and INSTEAD OF triggers call their trigger bodies
    differently than statement level triggers.
    When an event fires this type of trigger, the trigger declaration
    spawns a run-time program unit.
    The run-time program unit is the real “trigger” in this process.
    The trigger makes available new and old pseudo-record structures
    by communicating with the DML statement that fired it.
    The trigger code block can access these pseudo-record structures
    by calling them as bind variables.
    The trigger code block is an anonymous PL/SQL block that is only
    accessible through a trigger declaration.
  • Bind variables allow you to reach outside of a program’s scope.
    The :in and : out variables are bind variables inside trigger bodies.
    Only row-level triggers can reference these pseudo-record structure bind variables.
  • You can define multiple triggers on any object or event.
    Oracle 11g provides you with no way to synchronize which trigger
    fires first, second, or last.
    Triggers can slow down your application interface, especially row-level statements.
  • .

Posted in Oracle | Leave a comment

Privileges Required to Use Triggers

You must have the CREATE TRIGGER system privilege to create a trigger on an object that
you own. If the object is owned by another user, you’ll need that user to grant you the
ALTER privilege on the object. Alternatively, the privileged user can grant you the ALTER
ANY TABLE and CREATE ANY TRIGGER privileges.
You have definer permissions on your own schema-level components, but you must have
EXECUTE permission when you call a schema-level component owned by another user.

Posted in Oracle | Leave a comment