TechnoBuzz

A Techno Blog, mainly about Java

Beginning iOS

This project i used a storyboard and I added a label and a button to it. I then took the button on the storyboard clicked the control button and held it down into the controller (h file).

This generated code:

@property (weak, nonatomic) IBOutlet UILabel *display;

I then on the storyboard located the button and clicked control button held it down and dragged the link into the controller. This created a method in the controller. I added a print to the method:

#import “RookieViewController.h”

@implementation RookieViewController

@synthesize display;

– (IBAction)buttonDo:(id)sender {

NSLog (@”test”);

}
….

I then modified the above method to change the label on a button click:

– (IBAction)buttonDo:(id)sender {

NSLog (@”test”);

UILabel *label1 = self.display;

NSString *label1text =label1.text;

NSLog(@”the label was %@” ,label1text);

[label1 setText:@”Luke”];

}

RookieAppDelegate.h: define your class as a UI Reponder

@interface RookieAppDelegate : UIResponder

@property (strong, nonatomic) UIWindow *window;

@end

January 27, 2013 Posted by | Uncategorized | | Leave a comment

MVC can you see

link : “With your first glance at Spring MVC 2.5 you have probably noticed that controller methods don’t have to return a ModelAndView anymore.”

link: Some basics in Spring MVC 3 with how to construct a project, additional concepts, form processing, and more in a tutorial series.

link : an overview of Spring MVC which ends with a link to a video on Spring MVC

http://www.captaindebug.com/search/label/MVC

http://www.javavm.net/spring-mvc-controllers/

http://krams915.blogspot.com/2010/12/spring-3-mvc-using-modelattribute-in.html

http://stackoverflow.com/questions/10401402/how-to-share-sessionattributes-between-controllers-in-spring-mvc

http://richardchesterwood.blogspot.com/2011/03/using-sessions-in-spring-mvc-including.html

http://stackoverflow.com/questions/5938951/set-session-variable-spring-mvc-3

http://vard-lokkur.blogspot.com/2011/01/spring-mvc-session-attributes-handling.html

https://github.com/SpringSource/spring-mvc-showcase

https://src.springframework.org/svn/spring-samples/

http://sleeplessinslc.blogspot.com/2012/07/spring-mvc-31-presentation-and-tutorial.html?m=1

 

January 10, 2013 Posted by | Uncategorized, Web Design, Web/Tech | , | Leave a comment

Moving past scriplets

In the early days, while working in JSP files, the approach was to use scriplets to present server side data. Such as

Scriptlet <% code %>
– Code is inserted in service method.

JSP Expression <%= expression %>
– Expression is evaluated and placed in output.

Insert a help message into jsp file
<%
String s3 = new String();
s3 = s3 + “XYZ” ;
out.print(“<!– ” + s3 + ” –>”);
%>

Moreover, to generate javascript inside a JSP, you might do something like:

out.print(“<script>” + “alert” + “(‘” +situation.getValue() + “‘)” + “</script>”);

JSTL technology followed JSP (or even the Struts tag libraries) .

These objects allow for access to any variables that are held in the particular JSP scopes. Objects include:

  • pageScope
  • requestScope
  • sessionScope
  • applicationScope

${sessionScope.loginId} will return the session-scoped attribute named LoginId, or null if the attribute is not found.

<c:if test=”${someTest}”> Content</c:if>

<c:set var=”string1″value=”${item.value}” />

< c:out value=”${‘dmb: ‘} ${string1}” escapeXml=”false”/ >

Now, for javascript jstl integration:

var totRec = ‘<fmt:formatNumber type=”number” value=”${myCount}” />’;

 

January 6, 2013 Posted by | Uncategorized | Leave a comment