Can Struts 2 handle 3 action class calls at the same time - struts2

I am using ajax to load 3 jsps in a master page but the problem is it loads one after the other? I wanted to know if struts 2 can handle 3 action class calls at the same time? Or is it even possible to make such calls? My page is getting slow because of this, is there any other way to handle this?
<div id="content">
<div class="col1">
<div id="content_right">
<div class="curved section_content">
<div id="sub_header" class="curved_top">
<h2>
<s:text name="ft.history.title.details" />
</h2>
</div>
<sj:div cssClass="ajaxDiv" href="transferdetailhistory"
id="transfer_detail_content">
<div class="ajaxSection">
<div class="centeredAjaxSection">
<center>
<img style="vertical-align: middle;" alt="Loading"
src="${pageContext.request.contextPath}/img/bigindicator.gif">
</center>
</div>
</d‌​iv>
</sj:div>
</div>
</div>
</div>
this would load the history page, like wise i load 2 more jsps

Struts2 can handle significantly more than three simultaneous requests. There are many large, scalable applications using the Struts2 framework.
The issue is most likely related to your code.

we are in our application using such cases in every now and than and never faced problem with this.
better come up with some code may be problem with your code or some configuration as Steven said in his repply

Related

Using Bootstrap, how do I create 2 columns for content? - example included

I am new to using Bootstrap and want to create a responsive layout that has 2 columns side by side for my posts. Example
I want to achieve the 2 column arrangement seen under Portfolio. I have looked at the source and see various classes that don't seem to be included in the standard Bootstrap. I am using the Bootstrap version included with an MVC6 project in VS2013. Any help or a nudge in the right direction is appreciated.
My attempt to date causes this to occur. I end up with the gap.
Here my MVC code that causes the gaps to occur:
<div class="container">
#For Each item In Model.ToList
#<div class="col-md-6">
<div class="item">
<div class="content">
#Html.Raw(GetImageHelper.getImage(True, item.PostSummary))
<h3>
#item.PostTitle
</h3>
#Html.Raw(item.PostSummary.StripStyle)
</div>
</div>
</div>
Next
</div>
Thank you
It looks like you didn't use clearing properly. My solution for that issue is to use bootstrap row class. Following example also supports responsiveness:
<div class="row">
<div class="col-md-6 col-xs-12"></div>
<div class="col-md-6 col-xs-12"></div>
</div>
<div class="row">
<div class="col-md-6 col-xs-12"></div>
<div class="col-md-6 col-xs-12"></div>
</div>
...
This is an unequal height problem. Float tries to fill the available area as much as possible, but when you have one column that's taller than another, it knocks the next float object off to the right a little. While #luke is right that you can clear each row to solve the problem, that also kills your site's responsiveness, as now you can only have two or less per row. For this particular example, that may not be a problem. You've got an initially even number of columns and for very small screens you can just scale down to one per row. In other situations, though, such as wanting to have three per row perhaps in nice wide-screen displays, you'd be out of luck.
You might want to take a look at the article, Bootstrap 3 Responsive Columns of Same Height, on Minimit.

Multiple html pages using Intel App Framework

So I have an app that I am trying to strip out all of the JQuery Mobile and now use Intel's App Framework. I am having trouble figuring out how to integrate multiple html pages into the app so that I don't have to have all my code in a single file. I tried this:
$.ui.loadContent("page2.html");
but that doesn't seem to work. I get a 'loading content' spinner but nothing seems to happen.
How do I link pages together from different files?
Ok so I have figured it out. The documentation can sometimes be hard to search and there is no search box available on their website right now. But if you go to the quickstart and then then AFUI(on the left) and then panel properties they say:
data-defer="filename.html" - This will load content into the panel
from a remote page/url. This is useful for separating out content into
different files. af.ui.ready is not available until all files are
loaded asynchronously.
So in my index.html file I have something like this:
<div id="afui">
<nav>
<ul class="list">
<li>Post a Lunch</li>
<li>Personal Profile</li>
<li>Select University</li>
</ul>
</nav>
<!--Main View Pages-->
<div class="panel" title="Events" id="event-list_panel" data-defer="event-list.html" data-load="loadMainEventsList"> </div>
<div class="panel" title="Description" id="description_panel" data-defer="description.html" data-load="loadEventDetails"> </div>
<div class="panel" title="Select University" id="select-university_panel" data-defer="select-university.html"> </div>
</div> <!--id="afui"-->
and then I have the details of each page in seperate files. In my mind this does a literal copy/paste, and I haven't found any evidences yet that it isn't just a copy/paste.
Update:
in AF3 data-defer is now data-include

Posting a textarea with html content fails `No data received`

ok guys,
so here's another weird one:
i have the following form:
<form method="post" autocomplete="off">
<fieldset>
<legend>Edit article</legend>
<label>Description<textarea name="txtDescription"><%=article.Description %></textarea></label>
<label>Content<textarea name="txtContent"><%=article.Content %></textarea></label>
</fieldset>
<input type="submit" class="fr" value="save changes" />
</form>
there is nothing on the code behind page beside getting the article.
the page loads very fast, under 1 second, with that data in the textarea's.
when i try to submit this form, the page takes forever to load (actualy, it does not load at all, but fails after a few minuets with No data received.
the textarea content is just some html, not large (about 2-4kb each text area)
i have tried adding enctype="multipart/form-data", with no success, the same thing happens.
i have managed to narrow it down to the txtContent textarea, (i removed the description textarea)
and the page fails.
what makes this even worse is that if i open the page in the browser on my server,
it works with no problem, i can post, and it is all working as it should.
if i try to access the page from a remote machine, the post fails.
Anyone has any idea as to what happens here?
EDIT: just to make sure, i have created a simple HTML document with the following in it:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="header">
<nav>
<ul>
<li>Dashboard</li>
<li>Articles</li>
</ul>
</nav>
</div>
<div id="content">
<form method="post" action="test.html">
<fieldset>
<legend>Edit article</legend>
<label>Content<textarea name="txtcontent"></textarea></label>
</fieldset>
<input type="submit" class="fr" value="save changes" />
</form>
</div>
<div id="footer"></div>
</body>
</html>
this still fails.
EDIT: the test code shown here is the minimal code that is not working.
the actual form is larger, and if i remove the txtcontent textarea from the form,
the form submits with no problem, including the description textarea.
EDIT: Content-Length: 1555 / Content-Type: application/x-www-form-urlencoded
EDIT: i have uninstalled and reinstalled iis, and re-registered .NET
the problem is still there.
A few things to check....
What language are you using, e.g. ASP.NET WebForms, ASP.NET MVC and version?
I can see you are using
<form method="post" autocomplete="off">
In ASP.NET web forms, you would normally declare the form tag as
<form runat="server">
In ASP.NET MVC it would be similar to
#using(Html.BeginForm(......))
{
}
The other issue is you are posting HTML tags, by default ASP.NET will not allow this due to security reasons. Lookup XSS and be sure to understand the risks before disabling this feature.
Final note:
i have uninstalled IIS, Re-Installed IIS, Re-Registered .net framework,
and it seems to work fine now.
the reason for the original problem, unknown

Can I simplify this code with an HTML Helper?

I have the following code on my web pages:
<div class="rep_tb0" id="Activity" style="display:none;">
<div class="rep_tr0">
<div class="rep_td0" id="ActivityLog">Activity Log<br /><br /></div>
</div>
</div>
It's repeated for many pages and I would like to just code it once in one place. Can anyone tell me what are my options for doing this. Can I code an HTML Helper or is there a better / another way of doing this?
I think you need to use a partial in this case. Just create a .cshtml file and put that code in. Then call
#Html.Partial("PartialName");
Yes, build an HTML helper by creating an extension method. It's a lot easier than you think.
Check out this article:
http://weblogs.asp.net/jgalloway/archive/2011/03/23/comparing-mvc-3-helpers-using-extension-methods-and-declarative-razor-helper.aspx
Or this article:
http://www.asp.net/mvc/tutorials/creating-custom-html-helpers-cs

many little partials take up lot's of time to render, why, and how can I speed this up?

I have some 'boxes' that use a javascript scrolling library to display content. The box contains 4 visible content nuggets like this:
<div class="item nugget lesson">
<h3>
<a href="/en/dance_genres/22-authentic-jazz" title="Details and Information for 'Authentic Jazz'">
Authentic Jazz
</a>
</h3>
<div class="thumb">
<a href="/en/dance_genres/22-authentic-jazz" title="Details and Information for 'Authentic Jazz'">
<img alt="22" src="http://common-resources.idance.net.s3.amazonaws.com/images/model_resources/dance_genres/thumb/22.jpg">
</a>
</div>
History: Grounded in vintage videos, the modern revival of ...
<br>
<a href="/en/dance_genres/22-authentic-jazz" title="Details and Information for 'Authentic Jazz'">
<img alt="Lesson_view" src="/images/objects/lesson_view.png?1276105734">
</a>
</div>
When I render more than 50 of these partials, rails rendering load time is noticeable slow (over 2 seconds). I've optimized the sh*% out of my db queries and even added counter_cache fields, so that is not the slowdown.
I'm not talking about load in the browser, but rails processing time.
Please see load times here: http://pastebin.com/pSrNSSsF
Is this normal?
This is normal. You can try rendering a collection, for a bit of a performance gain. (Or cache.)

Resources