How to display mongoDB cursor in a jsp file - mongodb-java

I am just trying some code with mongodb..
The cursor I am showing on a jsp is by iterating over the cursor..
Is there a simpler way to display mongoDb cursor on jsp page?

I suggest you use skip and limit to page through the results.

Related

how i can dived page in freemarker ( the page is tall and want to have next and previse button )

I have a freemarker page but it is too long it is a list of items, so i would like to divide the page to more than one or have something link next and previse page. anyone has any idea?
The best option here is to put the list as a HTML table that contains pagination to it so that it can take care of the next and previous page data. For pagination on HTML you can refer the below answer How to use pagination on HTML tables?

CakePHP display updated table of data using ajax

I'm having real trouble finding any documentation on this.
I have a page that displays a list of users, above this i can edit the users successfuly with ajax. After the update, i want the table below to be updated with the new information.
How do i go about doing this? I'm thinking i need some sort of view that displays the data in a table, and i want to get that view's contents and inject it into my page, but i can't seem to find out how?
Can anyone point me in the right direction please
Put users table in div id like "Users" and do something like following in edit ajax success function call
$("#users").load("same_page_url #users");

Execute Oracle Apex Process from HTML link

I have some custom HTML that creates a table on my page with a bunch of images. For each image I would like to create a tag around it and call a process that has been defined in apex. How can I do this?
It seems that the only way to call processes is from a object that has been created by Oracle Apex such as a button item....
Two ways:
1) You can set up your link to submit the page with a request like this:
...
Then create a page process that runs when Request is equal to 'MYREQUEST'.
2) You can give your anchor an ID:
...
Then create a Dynamic Action that fires on the Click event for the jQuery selector '#myAnchor' and executes PL/SQL code.
Don't think you need the doSubmit Javascript function because if you go to the
report >> edit the column >> column link,
there is a Request field. You can put your request name there.
In page process condition type pick Request = Expression and put whatever you named the request.
I find javascript more flexible. For example you can implement confirmation dialog with customized text message like followings:
SELECT col1,
'submit' as link
FROM tab1
Regards,
Igor

MVC3 Paging - only load the rows in the current page

I want to create a WebGrid like control that would display a gallery (a list of images) that could have many pages. I don't want to load all the rows at the same time that's why I'm unable to use WebGrid and PagedList.
Is there any other alternative to this, taking only a portion of the rows (list.skip(x).take(y))?
Thanks,
czetsuya
See this post in ASP.Net forums
This method uses row wise results from database. This result is fetched according to the pagenumber.

jsp dynamic gui

i am asking myself if it is possible to somehow create a dynamic gui in jsp. So that i could have something like a dropdown menue for the country and based on what i have selected in that window a dropdown menue for cities, without reloading the jsp page. Or, in a dialog with multiple input lines, to be able to add an additional line with a button, again without reloading the whole page. In the first case the cities information would be in a database, in the second the information provided would be stored at the end in a database, so i cant just use java script (and don't really want to).
At a minimum, you would need to utilize JavaScript to implement what you want. Most would implement it the way Tim describes in his first paragraph.
Set up two .JSP's:
The first contains your main form with the country drop-down menu. Some JavaScript on the first .JSP triggers an AJAX request to a second .JSP. The second .JSP accepts a country-ID parameter and uses a servlet to query your DB for a list of cities, then renders that data. Once the request returns, the JavaScript in your first .JSP inserts the list of cities into a new drop-down menu.
This may seem complex, but several JavaScript libraries exist to assist you with this task. Look into jQuery or Dojo.
To update the page without posting back the whole page, the browser would use ajax. Using a database does not eliminate ajax. Ajax calls server code that digs your data out of the database.
Regardless, to do what you want, without writing your own javascript, look at GWT (Google Web Toolkit). You right ajax applications in Java that generates the javascript for you.

Resources