I know that I know nothing

tinymce Editor

clock June 20, 2015 21:00 by author Administrator

if you use tinyMCE  in ajax you will use mce api to get content and set content 

this example show how can use it 

function loadComplete(entity){




function beforeSave(entity){



         return entity;



<form id="frm_main" data-options="onLoadComplete:loadComplete,beforeSave:beforeSave'">

    <textareaid="editor"data-bind="informationText"  class="editor"style="height: 200px;direction: rtl" ></textarea>


remote debug in tomcat

clock May 9, 2015 19:12 by author Administrator

add this line jvm args


create jndi in tomcat

clock May 9, 2015 18:55 by author Administrator

Create META-INF/context.xml

<Context  docBase="appName" path="/" reloadable="true" >

    <Resource name="develop" auth="Container" type="javax.sql.DataSource" maxActive="50        
          maxIdle="30" maxWait="10000" username="test"    password="test"

        driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@" />



web.xml configuration


        <description>jdbc Datasource example</description>

The value of attribute "formula" must not contain the '<' character.

clock May 8, 2015 12:43 by author Administrator

hibernate formula dosenot allow user < in select for example i use this formula and get this exception

  <property name="debitPrice"  not-null="true"   formula="(  select nvl(sum(d.cost_price),0) from ihs_flat_cost_assign d where d.flat_id=Id  and d.cost_price <=0   )  "   />


and i change that to this

        <property name="debitPrice"  not-null="true"   formula="(  select nvl(sum(d.cost_price),0) from ihs_flat_cost_assign d where d.flat_id=Id  and 0>=d.cost_price    )  "   />

and problem solve

crazyyyyy bug i dont know whyyyyy

send email after commit using spring transaction

clock May 6, 2015 21:22 by author Administrator

Sometimes you want a little more control over transaction but at the same time you don't want to switch to programmatic transaction management. I'm talking about cases when you want to execute some activities only when transaction was completed successfully. For example: send an email with registration details, update a cache, send a message over network, etc. The tricky part here is that you want to perform these activities from a transactional method (a method marked with @Transactional which automatically will start and end the transaction).


public class AfterCommitExecutorImpl extends TransactionSynchronizationAdapter implements AfterCommitExecutor {
    private static final Logger LOGGER = LoggerFactory.getLogger(AfterCommitExecutorImpl.class);
    private static final ThreadLocal<List<Runnable>> RUNNABLES = new ThreadLocal<List<Runnable>>();

    public void execute(Runnable runnable) {"Submitting new runnable {} to run after commit", runnable);
        if (!TransactionSynchronizationManager.isSynchronizationActive()) {
  "Transaction synchronization is NOT ACTIVE. Executing right now runnable {}", runnable);
        List<Runnable> threadRunnables = RUNNABLES.get();
        if (threadRunnables == null) {
            threadRunnables = new ArrayList<Runnable>();

    public void afterCommit() {
        List<Runnable> threadRunnables = RUNNABLES.get();"Transaction successfully committed, executing {} runnables", threadRunnables.size());
        for (int i = 0; i < threadRunnables.size(); i++) {
            Runnable runnable = threadRunnables.get(i);
  "Executing runnable {}", runnable);
            try {
            } catch (RuntimeException e) {
                LOGGER.error("Failed to execute runnable " + runnable, e);

    public void afterCompletion(int status) {"Transaction completed with status {}", status == STATUS_COMMITTED ? "COMMITTED" : "ROLLED_BACK");




final String email = user.getEmail();
            afterCommitExecutor.execute(new Runnable() {
                public void run() {
                    mailService.sendMail(email, "CreateUser", params, "templates/email/CreateUser.ftl");


clock May 2, 2015 22:09 by author Administrator

“I’m the smartest man in Athens because I know that I know nothing.” —Socrates 470-399 BC

jsoup: Java HTML Parser like jquery

clock May 2, 2015 19:01 by author Administrator

jsoup is a Java library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods.


String userURL = "";

content of this request contain this tag


<input type="text" id="txt_title" value="title"  />
Document doc = Jsoup.connect(userURL).get();



What's the difference between <%@ include file="header.html" %> and <jsp:include page="header.jsp" />

clock April 9, 2015 21:18 by author Administrator



1) The include directive: <%@ include file="header.html" %>

Static: adds the content from the value of the file attribute to the current page at translation time. The directive was originally intended for static layout templates, like HTML headers.
2) The <jsp:include> standard action <jsp:include page="header.jsp" />

Dynamic: adds the content from the value of the page attribute to the current page at request time. Was intended more for dynamic content coming from JSPs.
3) The <c:import> JSTL tag: <c:import url=”” />

Dynamic: adds the content from the value of the URL attribute to the current page, at request time. It works a lot like <jsp:include>, but it’s more powerful and flexible: unlike the other two includes, the <c:import> url can be from outside the web Container!


ref :


get Locale in java

clock April 9, 2015 20:24 by author Administrator



create custom dependency in maven

clock April 9, 2015 18:33 by author Administrator

mvn install:install-file -Dfile=/azizkhani/font.jar -DgroupId=org.roshan  -DartifactId=font -Dversion=1 -Dpackaging=jar

About the author

 Welcome to this web site . This page has two purposes: Sharing information about my professional life such as articles, presentations, etc.
This website is also a place where I would like to share content I enjoy with the rest of the world. Feel free to take a look around, read my blog

Java,J2EE,Spring Framework,JQuery,

Hibernate,NoSql,Cloud,SOA,Rest WebService and Web Stack tech...


Month List

Sign In