WSO2 ESB – Unable to access properties set in script mediator in a payload mediator

Uncategorized
Question: I've got a Script mediator where I've set a certain value (mc.setProperty("x",1)) and immediately after the script mediator I've set a PayloadFactory mediator where I'm trying to get the value x (get-property("x")). I used Log mediators in between my mediation logic to check if the property value is set. But the value isn't set. I'm using js for Script mediator. Answer: Read more
Read More

What is logic to construct a binary tree?

Uncategorized
Question: I have a while loop which continuously takes integers until -1 is entered. Those elements must be inserted into a binary tree (not a BST). If it was a BST, we have a condition for where to insert the new node. But how can I construct a binary tree? I mean if nodes are 1,2,3,4,5,6..., then 1 is the root, 2 and 3 are the left and right children of node 1, 4 and 5 are the left and right children of node 2, and 6 is left child of node 3, like this:if(root==NULL) root= newnode; else{ if (root->left==NULL) root->left= insert(root->left,element); else root->right= insert(root->right,element); } return root; How do I create a tree like this? Answer: One simple way of doing this is use level order traversal. Whenever you…
Read More

Can I run a Java Spring Batch program in JavaSE environment?

Uncategorized
Question: We are exploring deployment/execution modes for the Java batch programs being created for z/OS (mainframe) Option 1: Deploy it in Liberty profile Option 2: Can I run Spring Batch program in a JavaSE environment ? Answer: Yes. There is no required dependency on an application server for Spring Batch. In fact, using Spring Boot to generate an über jar and running it that way is the recommended approach for running Spring Batch jobs currently. Read more
Read More

In JavaScript, which types support toString()?

Uncategorized
Question: The good:'hello'.toString() // "hello" let obj = {} obj.toString() // "[object Object]" The bad:undefined.toString() // throws TypeError null.toString() // throws TypeError Are there any other types that will throw on the .toString() method? thanks Answer: every obj that inherited from Object has to string method. Starting from javascript Starting in JavaScript 1.8.5 toString() called on null returns [object Null], and undefined returns [objectUndefined]. You can read more about it at this link: You can read more about it at this link Read more
Read More

infinite loop while accessing resource folder

Uncategorized
Question: In my spring project i have written a filter to handle all requests.it works fine, but while accessing the resource an infinite loop happening. i defined my resource folder under a class extends WebMvcConfigurerAdapter this is the code that i used to define resource folder:- this is my request url:@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**").addResourceLocations("/resources/"); } http://localhost:8080/abc/resources/images/chart/receivableaccounts.png while accessing this url through browser the request is proceesing number of times in console(eclipse). i can't identify what's the real problem is. here is my RequestFilter:package org.abc.app.config; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import org.businesscognizance.app.util.Session; /** * Custom filter created for handling all incoming,outgoing requests * * @author Jishnu * */ public class RequestFilter…
Read More

value not being updated after saga call react-redux

Uncategorized
Question: I am using react-redux along with redux-saga. now I have problem that I have Modal which updates multiple value and click on save saga calls multiple times and reflects updated value on page. but on clicking of save it is not updating value on page.I need to make something to reload page i.e refresh but ideally my DOM should re render it,shouldn't it? here is my saga import { call, put } from 'redux-saga/effects'; import { update } from '../services/api'; import * as types from '../constants/actionTypes'; export default function* updateSaga({ value }) { try { const updateData = yield value.map(data =>{ return (call(update,data))} ) yield [ put({ type: types.UPDATES, updateData: updateData }) ] } catch (error) { console.log("porfilingerror",error); yield put({ type: 'FETCH_UPDATE_ERROR', error }); } } Here's my reducer…
Read More

link background not changing according to what i want

Uncategorized
Question: Here is my code example The .navbar has 0.5 transparency and also do not want the background of links changed when hovering. (right now background is white) If i use navbar-default class then i can change background of list items and links but not able to do the transparency thing. And if i dont use navbar-default/inverse i am able to do navbar transparent but links have some background property on hover, which i am not able to override. HTML Toggle Home About Portfolio Contact CSS .navbar { background: rgba(0, 0, 0, 0.5); font-family: avro; } .nav li a:hover { background: none; } Answer: Sadly you need to override boostrap style with !important. Besides this I would not recommend to use background:none; you only need to override the background-color property…
Read More