Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Bilal Ghayad

Ranch Hand
+ Follow
since Sep 29, 2018
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bilal Ghayad

Yes it is not condition to be JSP, I just used JSP because I am using Spring MVC.
I need solution in to be done using html, JavaScript and CSS. How?

I posted this question in Java forum because I was think if there is such thing in Java that can be returned to the page (to the browser) to be displayed. But if this is not existed in Java, then I would to do this using html, JavaScript and CSS, but how?

Regards
Bilal
Hello Paul;

Thank you a lot.
Using ul and li with JavaScript is very good.
But how to make the lines that connect the nodes together and the subtrees together which on the same level (line or dot line), how to have this?

Regards
Bilal
2 months ago
JSP
Hello;

I need to use Tree in my JSP page, by the way: I am using Spring MVC.
Is it possible to generate this tree in Java Code and to be sent for the JSP page to be used?
I am looking for this because I am not able to find good javascript tree which is free. Excep jsTree, but I need other than jsTree.

Regards
Bilal
2 months ago
JSP
Hello;

I wrote my spring mvc application to work based on the http://localhost:8080 is the root directory, and every thing is working fine.

So my web.xml was having the following servlet-mapping settings:



But now when I came to the deployment, I am deploying the application under the directory NEP_WF_CLIENT, so the root url will be: http://ip_address:8080/NEP_WF_CLIENT instead of http://ip_address:8080, so what is the best modification that I have to do it?

I know that I have to change the servlet-mapping to become:


But, that will require to do too many changes (for each controller, I have to do the change in the mapping and in the returning), and that is a big effort just because I placed the application under new directory.
What is the solution to avoid having complete changes? I am sure there is a way using prefix and suffex (adding or removing) that will resolve the problem.

Appreciate the kindly help.
Regards
Bilal
4 months ago
The problem resolved.

The reason of the problem was in the line <context:component-scan base-package="com.airtel.siva.Services" /> which is in the servlet-context.xml, the package name should be com.airtel.siva.services instead of Services.
Case sensitive is not effecting in microsoft windows but it is effecting in unix and the deployment was in the unix.

Regards
Bilal
4 months ago
Hello;

This problem I do not face it when running my application at eclipse, but I faced this error when deploying the war file on the tomcat server (apache-tomcat-8.0.33), it seems it is related to the componentscan and autowire, but I am not able to know the reason exactly and how to resolve it:

ERROR: org.springframework.web.servlet.DispatcherServlet - Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'formController': Unsatisfied dependency expressed through field 'formServices'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.airtel.siva.services.FormServices' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}



Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.airtel.siva.services.FormServices' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}



Actually, in the FormController Class I have the following code:



In the servlet-context.xml:


<context:component-scan base-package="com.airtel.siva.Controllers" />
<context:component-scan base-package="com.airtel.siva.Services" />



While FormController Class is located under package: package com.airtel.siva.Controllers;

Moreover, the FormController Class and the FormServices Class are annotated as following:





As you see, FormServices is class and not interface and it is annotated by @Service while FormController is annotated by @Component, but the strange that it worked with me when running the application from eclipse and gave me the error while deploying the war file.

So what could be the reason for this and why it appeared only when deploying the war file?

Do I have to add ComponentScan at some place and I am missing this? Or I have to do another annotation to be able to use @Autowire for FormService class in the FormController class?

Regards
Bilal
4 months ago
Thanks a lot for all of you. I found the problem.
The reason of the problem was because the url was https and not http and when I checked the spring.schemas which contains the mapping, it was configured for http and not https. So all what I did, I changed the https to http instead of https and the error went out.


root-context.xml after changing the link from https to http:

<beans xmlns="http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">




spring.schemas:

http\://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-4.3.xsd




Regards
Bilal
4 months ago
OK I understood you, I have to keep it directing for http and I have to add internal resolver.

Can you direct me how you did the internal resolver and instead of going to the internet, it is finding them locally, how?

Regards
Bilal
4 months ago
Hello Tim and All;

Thanks a lot for all of you.

This is often done by modifying the xsi:schemaLocation to point to a local file instead of to a URL



My problem is where to place this XSD file and how to direct for it locally.

Let me tell you what did and what I obtained and where is my problem:

I placed the file required XSD files in my local computer and this was under this path: C:/Users/Bilal/.m2/repository/org/springframework/spring-beans/factory/xml/spring-beans.xsd

And I was able to direct for it using this syntax:

xsi:schemaLocation="http://www.springframework.org/schema/beans file:///C:/Users/Bilal/.m2/repository/org/springframework/spring-beans/factory/xml/spring-beans.xsd";

But where is the problem of using file:///C:/Users/Bilal/.m2/repository/org/springframework/spring-beans/factory/xml/spring-beans.xsd?

The problem is that this directory at my laptop, and when we do deployment using the war file, this path will not be existed and the files will not be available.

I need to place this XSD file in a path that is exported with war file and I need to know how to direct for it properly, using file: or using classpath:? How the syntax will be?

Appreciate the kindly help please.
Regards
Bilal

4 months ago
Thanks a lot for your kindly reply and support.

It is error and below is the error line:



And yes, this problem is appearing because there is no Internet but of course there is network.
The project is failing to run.

Regards
Bilal
4 months ago
Hello;

I am running Spring MVC project and when I reached for deployment (I generated WAR file for deployment team and they use it to do the deployment), I faced an error that we were not see it when we were running the project from eclipse (Run as Maven Build). I am sure this is because the deployment is happening on machine that does not have Internet. The error is related to downloading the XSD file that is needed in the root-context.xml file.

The error is saying:



I know that I have to place the spring-beans.xsd file locally and change the xml configuration to direct for it, but I do not know in which path I have to place this file and what the configuration that I have to place in the root-context.xml file to be able to find this file.

From the other side, I am posting here the root-context.xml file:




Appreciate the kindly help please.

Regards
Bilal
4 months ago
Hello;

I have jsp page that contains form with parameters that belongs to multiple beans at the controller side where each bean is mapped to database table.
I am thinking to use input tag in the jsp page, but I do not know really how to distinguish between the parameter that belongs to bean A or that belongs to bean B and so on and how to handle them at the controller in away that I can retrieve these parametes in the controller to be able to save it or even return some of it to the jsp page.

Actually the problem in how to make the form action that is related to multiple beans mapped to different tables in the database.
Aprpeciate the kindly help.


Regards
Bilal
6 months ago
JSP
Hello;

We are using easypiechart  in our html page and this easypiechart is a JavaScript file that is included in the page using <script>src="js/easypiechart.js"</script>, the problem that I am facing that if values are changed, we need to re-draw the circle of the easypiechart without refresh the page, so I am not able to know how to do this. So I appreciate if possible to help.

This easypiechart was obtained from template from this link: https://mediatool.com/

By the way, I am able to change the values of the easypiechart, I can do this using the following:



But I do not know which method to called to re-draw the circle of the easypiechart.

Below are the scripts that are used:



And below is the easypiechart.js code (I know it is long, but I have to add it):




Regards
Bilal
Hello;

I need to use Grid with filter, so while entering the characters, it is filtering the data in the grid without pressing enter, also I need it to scroll horizontally and vertically in addition to being able to change its color, so you please advise me with such grid.

Note: I need to use jquery and ajax (javascript) and I do not need to use angular, because I am using Java Spring MVC framework where I can use jquery and ajax.

Regards
Bilal
Hello;

If I have Spring MVC application which is using dispatcher, view resolver and controller and if I need some pages to be created using angular and some pages to be created using jsp of the spring mvc.
My question is: how to route to the angular page if we were navigating the spring mvc page (jsp page) and how to route for the spring mvc page (the jsp page) if the user was in the angular page?
Shall I consider them two separated applications? Even, how to be able to route between them (to spring mvc jsp from angular and to angular from spring jsp)?
What is the required configuration at the dispatcher config file and which annotation to be used in the mvc controller? Same thing about angular, what is needed to be done?

Regards
Bilal
7 months ago