how to update values automatically from database - java

i am doing mvc project and i want to update the web page automatically when the web page is loaded.
Ex: web page 1 is used to add the companies in database,web page 2 is used to delete the companies,when the web page 2 is loaded automatically in the web page 2 select box should appear with the values as company names to delete the companies from database.
i am expecting to use ajax here to automatically load the data but problem is to fetch the data from database i am using java class instead of jsp or servlet,so i am not understanding how to fetch the data from java class and use to load automatically in web page 2 for the select box.
Please help me on the same.

In this scenario, you have to use servlet, with which ajax will interact to fetch the values on page2. In servlet, you can call you java class to make database connection. Hope it helps!

Related

Filtering a Web Service Data Control in JDeveloper

I have a web service data control in JDeveloper 12.2.1.3.0 which I show in a table on a page fragment, but I need to filter by one of the attributes and show the filtered data in the table and I don't know how to do that because there is no Named Criteria tab in the data control configuration page.
I looked at the data control configuration file but didn't find any option for adding a filter.
Any help will be really appreciate it, thank you all in advance!
One solution is to call or implement a web service, that returns the data already sorted and/or filtered.
If this can't be done, you have to get the data from the web service in a POJO model and filter/sort it yourself.

Spring and eclipseLink refresh?

So I am doing a Java web project using Spring as ORM and eclipse link.
The problem I am having is that after I insert, delete or update data in my database through my web application, the data is refreshed in the mySQL database, but when I go back to my view page the new data isn't there so I have to restart my whole program for the new data to be displayed.
How can I refresh my web application to display the newly inserted, updated, or deleted data without having to restart my whole program?
You aren't saying what front end tech you are using. Angular, React, jQuery?
With a library like Angular you just bind an array representing the data to the view. When you update the array the view auto updates.
You would typically update the array on a success response from the server. So, for example, on a 201 (created), in the promise callback (the .then block) you would update the array with the newly added data. Updating the bound array will update the view.
With libraries like jQuery there is no binding to the view. Instead, you would update the array and then update the HTML dynamically via JavaScript. This would typically be done in an AJAX request callback. See the jQuery.ajax method.

Create Dynamic Subdomains using Spring?

I am developing an application using Spring , jsp and Apache 7.0 server, now suppose i have register domain such as "www.example.com" and in my application the user fills the registration form in which the user is ask to enter his url to name such "123" as soon he submit the form after filling details i want to redirect the him to the newly created URL now in our case "123.example.com"
Now at this movement i have to create sub domain in my code itself before he gets redirected. I have gone through google not find much.
Any help
Thanks in advance.

Providing liferay user id into orbeon form runner generated xml

I make portal based on Liferay, which has funcionality associated with Orbeon. I run Orbeon form runner inside html frame and I want to insert some extra data like Liferay-User-Id into xml generated by filled form. Is there some possibility to make that or other idea that helps me provide, user's id who filled form, to database?
regards
Since Orbeon Forms 4.4, the Liferay proxy portlet allows you to propagate user information as headers. This is possible because the portlet has access to Liferay user information.
From within an iframe, it's a different story. If you manage to set URL parameters, then you can retrieve them from your form with the xxf:get-request-parameter() function.

Make a web page inaccessible for users

I have a web application(J2EE+apache+struts2+jsp+jqgrid) and some JSPs(in /webcontent/data_provider folder) that jQGrid uses them to fetch data from mysql DB and fill the grid with, but I don't want users to access those JSPs.
What can I do?
Thanks in advance buddies.
put those JSP into WEB-INF or create a filter that particular URL gets hit and check if user is authenticated to access it allow, restrict otherwise

Categories

Resources